I'm trying to load the "sf" package and had the follow error warning:
Error: package or namespace load failed for ‘sf’:
.onLoad failed in loadNamespace() for 'units', details:
call: udunits_init(path)
erro: no database found!
I tried to reinstall packages, Rcpp, units, and sf but it still doesn't work. This same problem is happening with another package rnaturalearth. Somebody can help me solve the units package problem please?
To give a little background on this error: the {sf} package depends on a whole host of external libraries, one of which is udunits2 (wrapped for use in R in package units, the naming is somewhat confusing). A small C library for unit conversion, which seems to be missing or corrupted on your computer, even though the wrapper R package is present. You will need to reinstall it.
As the library is external to R it will have to be done on your OS level - so it matters if you are on Windows, Linux or Mac. Linux instructions can be found at GitHub - r-quantities/units: Measurement units for R