sf Package installs but doesn't load.

Please help!!!
I can install the sf package, but whenever I try to load the package, it returns the following error:

install.packages("sf")
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/sf_1.0-4.zip'
Content type 'application/zip' length 42008733 bytes (40.1 MB)
downloaded 40.1 MB

package ‘sf’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\ARDE\AppData\Local\Temp\Rtmpu2sM4Q\downloaded_packages

library(sf)
Error: package or namespace load failed for ‘sf’:
.onLoad failed in loadNamespace() for 'units', details:
call: udunits_init(path)
error: function 'Rcpp_precious_remove' not provided by package 'Rcpp'
In addition: Warning message:
package ‘sf’ was built under R version 4.1.2

What can I do in this respect? Please help!!!

Is Rcpp installed? You could install/reinstall that, then restart and try again.

1 Like

Thanks a lot. Reinstalling Rcpp did the trick. It was installed already, but dont know why wasnt working/responding. I reinstalled it as u said and now the sf package is loading smoothly. Thanks again.

1 Like