I am using R on a shared cluster, which uses CentOS7.
I only have issues with installing this specific package, "sf" (simple features).
I have tried a solution I found online -(install.packages - pass configure arguments to install packages in R - Stack Overflow) but it still ran the same error.
I also asked the program administrator for our university's cluster, and he reassured that udunits2 is already installed in this library (/usr/include/udunits2/).
install.packages('sf',configure.args=c(sf="--with-udunits2-include=/usr/include/udunits2") ... Configuration failed because libudunits2.so was not found. Try installing: * deb: libudunits2-dev (Debian, Ubuntu, ...) * rpm: udunits2-devel (Fedora, EPEL, ...) * brew: udunits (OSX) If udunits2 is already installed in a non-standard location, use: --configure-args='--with-udunits2-lib=/usr/local/lib' if the library was not found, and/or: --configure-args='--with-udunits2-include=/usr/include/udunits2' if the header was not found, replacing paths with appropriate values. You can alternatively set UDUNITS2_INCLUDE and UDUNITS2_LIBS manually.