ncdf4
쉘 스크립트에서 실행되는 R 스크립트를 사용하여 원격 컴퓨터에 R 패키지를 설치 하려고 합니다 .
다른 패키지를 설치해 보았는데 잘 작동했지만 ncdf4
이 패키지에서는 작동하지 않았습니다.
내 R 스크립트는 다음과 같습니다.
install.packages('ncdf4', repos = "http://cran.us.r-project.org")
쉘 스크립트의 출력은 다음과 같습니다:
^LInstalling package into ‘/my/directory/R/x86_64-pc-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
trying URL 'http://cran.us.r-project.org/src/contrib/ncdf4_1.16.tar.gz'
Content type 'application/x-gzip' length 121420 bytes (118 KB)
==================================================
downloaded 118 KB
* installing *source* package ‘ncdf4’ ...
** package ‘ncdf4’ successfully unpacked and MD5 sums checked
configure.ac: starting
checking for nc-config... no
-----------------------------------------------------------------------------------
Error, nc-config not found or not executable. This is a script that comes with the
netcdf library, version 4.1-beta2 or later, and must be present for configuration
to succeed.
If you installed the netcdf library (and nc-config) in a standard location, nc-config
should be found automatically. Otherwise, you can specify the full path and name of
the nc-config script by passing the --with-nc-config=/full/path/nc-config argument
flag to the configure script. For example:
./configure --with-nc-config=/sw/dist/netcdf4/bin/nc-config
Special note for R users:
-------------------------
To pass the configure flag to R, use something like this:
R CMD INSTALL --configure-args="--with-nc-config=/home/joe/bin/nc-config" ncdf4
where you should replace /home/joe/bin etc. with the location where you have
installed the nc-config script that came with the netcdf 4 distribution.
-----------------------------------------------------------------------------------
ERROR: configuration failed for package ‘ncdf4’
* removing ‘/my/directory/R/x86_64-pc-linux-gnu-library/3.3/ncdf4’
The downloaded source packages are in
‘/tmp/RtmpJLxXFq/downloaded_packages’
Warning message:
In install.packages("ncdf4", repos = "http://cran.us.r-project.org") :
installation of package ‘ncdf4’ had non-zero exit status
Error in library(ncdf4) : there is no package called ‘ncdf4’
Execution halted
이전에 이 문제가 발생한 적이 있나요? 어떤 제안이 있으십니까?
감사해요
답변1
library 가 누락된 것 같습니다 netcdf-*
. 어느 라이브러리인지는 확실하지 않습니다.
sudo apt install netcdf-*
apt를 패키지 관리자로 사용하면 작동합니다.