I'm trying to create an object with name "
trainData' and where '
samples_area ' is a shapefile layer with polygons only. I've set the directory to the folder that contains '
trainData <- readOGR("samples_area", "polygons") Error message: Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv, : Cannot open data source
Someone, please rectify my mistake.