rgdal package is not working in R 4.2.3 used Sf package but without success

33 Views Asked by At

rgdal packge is not working anymore. I used writeOGR

 writeOGR(occ_sp, species_set[i], driver = "ESRI Shapefile", dsn = dsn, overwrite = TRUE)

error:

Error in writeOGR(occ_sp, species_set[i], driver = "ESRI Shapefile", dsn = dsn, : could not find function "writeOGR"

I moved to use st_write to save my spatialpointsdataframe to shape file. This produce the errors.

st_write(occ_sp,"occ_sp.shp")

error:

Error in UseMethod("st_write") : no applicable method for 'st_write' applied to an object of class "c('SpatialPointsDataFrame', 'SpatialPoints', 'Spatial', 'SpatialVector')"

0

There are 0 best solutions below