Package installation problem (sf, rlang)

Hi there!
I'm doing statistical analysis of temporal and spatial dependencies in environmental datasets.
I need the 'spdep' package.
But I can't install and load it because my 'sf' package (required for 'spdep') is also impossible to load.
I get this error message:

Error: failed to load package or namespace for 'sf' :
.onLoad failed in loadNamespace() for 'units', details :
call: udunits_init(path)
error: no database found!
addition: Warning message:
the 'sf' package was compiled with version R 4.1.3

I don't know how to do this.
I have version R 4.1.1.
I tried with version R 4.0.5 and R 3.6.2, I tried downloading new versions of Rtools.
I've tried downloading directly via CRAN, and also with the ZIP file. I tried installing it via GitHub... Nothing works, and I don't understand the problem.
Please help! Thank you,


The error you show is not with {sf} package, but with {units} (one of the sf packages dependencies). It has a small C dependency that is gets installed on system level, and which has a small local database of valid units. Which seems to be missing / corrupted in your case. This has been a known issue on unix based installations, but you seem to be running Windows (which which I am no longer familiar).

Are you able to install units? From CRAN, source, whatever?

Thank you for your reponse.
The 'units' package also sends an error message when it is installed, either via CRAN or with ZIP files. I've just managed to get 'sf' to work by installing the 'udunits2' package (not 'units')!
But 'units' still doesn't work...

Can you post the error messages you are getting when you try installing {units}?

What happens if you try installing {units} at terminal (Windows GUI?) level?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.