解决方案
返回命令行, 我的系统是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