R:使用putty安装包

时间:2014-09-21 20:43:44

标签: windows r putty

在Windows上运行我的R脚本后,我想使用另一台服务器机器进行计算。我使用putty和云计算提供商进行切片。

这就是我现在所做的事情:

sudo tsocks apt-get install r-base-core #R
sudo tsocks apt-get install default-jre #java
sudo apt-get install r-base-dev
tsocks wget #to upload my R script
tsocks wget #to upload data which are used by the R script
到目前为止一切顺利。然后我跑R并进入R环境。

在R中我尝试安装一些软件包,如:

install.packages("nloptr", repors="")

这就是以下内容:

Installing package(s) into ‘/home/slicify/R/x86_64-pc-linux-gnu-library/2.14’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---

然后我在瑞士选择一台服务器并继续。这花了很多时间,最后我得到了这个错误:

Warning: unable to access index for repository http://stat.ethz.ch/CRAN/src/contrib
Warning messages:
1: In open.connection(con, "r") :
  unable to connect to 'cran.r-project.org' on port 80.
2: In getDependencies(pkgs, dependencies, available, lib) :
  package ‘nloptr’ is not available (for R version 2.14.1)

有人可以帮我解决上述问题吗?非常感谢你

更新:

错误(命令行没有继续)

install.packages("nlopt-2.4.2.tar.gz",repos = NULL, type="source")

Installing package(s) into ‘/home/slicify/R/x86_64-pc-linux-gnu-library/2.14’
(as ‘lib’ is unspecified)
ERROR: cannot extract package from ‘nlopt-2.4.2.tar.gz’
Warning message:
In install.packages("nlopt-2.4.2.tar.gz", repos = NULL, type = "source") :
  installation of package ‘nlopt-2.4.2.tar.gz’ had non-zero exit status
> install.packages("nloptr_1.0.4.tar.gz",repos = NULL, type="source")
Installing package(s) into ‘/home/slicify/R/x86_64-pc-linux-gnu-library/2.14’
(as ‘lib’ is unspecified)
* installing *source* package ‘nloptr’ ...
** package ‘nloptr’ successfully unpacked and MD5 sums checked
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking for pkg-config... no
configure: Now testing for NLopt header file.
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking nlopt.h usability... no
checking nlopt.h presence... no
checking for nlopt.h... no
configure: Need to download and build NLopt
trying URL 'http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz'
Error in download.file(url = "http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz",  :
  cannot open URL 'http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz'
In addition: Warning message:
In download.file(url = "http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz",  :
  unable to connect to 'ab-initio.mit.edu' on port 80.
Execution halted
/bin/tar: This does not look like a tar archive

gzip: stdin: unexpected end of file
/bin/tar: Child returned status 1
/bin/tar: Error is not recoverable: exiting now
Warning message:
In untar(tarfile = "nlopt-2.4.2.tar.gz") :
  '/bin/tar -xf 'nlopt-2.4.2.tar.gz'' returned error code 2
configure: Starting to install library to /tmp/Rtmpch92Ql/R.INSTALL31457068e238/nloptr/nlopt-2.4.2
./configure: line 3325: cd: nlopt-2.4.2: No such file or directory

0 个答案:

没有答案