I have the rgdal abd raster libraries running
I'm trying to open a .shp map in R I've already tried
setwd("C:/Users/user/Documents/tarso first paper/R")
study_area <- readOGR("municipios.shp")
did not work so I tried
study_area <- readOGR("C:/Users/user/Documents/tarso first paper/R/municipios.shp")
study_area <- readOGR("C:/Users/user/Documents/tarso first paper/R","municipios.shp")
study_area <- readOGR("C:/Users/user/Documents/tarso first paper/R/municipios")
study_area <- readOGR("C:/Users/user/Documents/tarso first paper/R","municipios")
Also, it didn't work... Whenever there is one of the 2 types of error message, "Cannot open layer" or "Cannot open data"
Data source is governmental and open in Qgiz So the data is probably ok
I have no idea how to fix it....
You should not be using
readOGRanymore because the underlying package (rgdal) will be retired soon. Instead of "raster" you should now use "terra".For example: