解決方案
返回命令行, 我的系統是centos, 安裝 udunits2-devel
, 安裝成功後, 再安裝units即可.
yum install udunits2-devel
進入R語言:
install.packages("units")
報錯信息
configure: error: in `/tmp/RtmpzjXRgt/R.INSTALL4b639c73b72/units':
configure: error:
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
See `config.log' for more details
ERROR: configuration failed for package ‘units’
* removing ‘/usr/lib64/R/library/units’
The downloaded source packages are in
‘/tmp/RtmpDXaNCW/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("units") :
installation of package ‘units’ had non-zero exit status