这是一个非常普遍的问题,通常人们会问。然而,迄今为止,没有任何现有答案能够帮助我。
我正在使用Windows 7,已经在我的计算机上安装了R,但是我无法安装任何软件包。
我尝试按照这里所说的去做,但对于我来说,不仅是编程文件被阻止了,而且是只能成为用户的root。
例如,当我尝试安装软件包时,我会得到以下提示:
> install.packages("ggplot2")
--- Please select a CRAN mirror for use in this session ---
Warning: unable to access index for repository http://cran.mirror.garr.it/mirrors/CRAN/src/contrib
Warning: unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/src/contrib
Warning: unable to access index for repository http://cran.mirror.garr.it/mirrors/CRAN/bin/windows/contrib/3.2
Warning: unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.2
Warning messages:
1: In open.connection(con, "r") :
unable to connect to 'cran.r-project.org' on port 80.
2: package ‘ggplot2’ is not available (for R version 3.2.0)
如果我按照以下步骤操作,我不确定是否真正安装了该软件包。
例如:
> setInternet2(TRUE)
> install.packages("devtools")
also installing the dependencies ‘mime’, ‘R6’, ‘bitops’, ‘brew’, ‘httr’, ‘RCurl’, ‘memoise’, ‘whisker’, ‘evaluate’, ‘rstudioapi’, ‘jsonlite’, ‘roxygen2’
trying URL 'http://cran.mirror.garr.it/mirrors/CRAN/bin/windows/contrib/3.2/mime_0.3.zip'
Content type 'application/zip' length 35053 bytes (34 KB)
downloaded 34 KB
trying URL 'http://cran.mirror.garr.it/mirrors/CRAN/bin/windows/contrib/3.2/R6_2.0.1.zip'
Content type 'application/zip' length 123320 bytes (120 KB)
downloaded 120 KB
trying URL 'http://cran.mirror.garr.it/mirrors/CRAN/bin/windows/contrib/3.2/bitops_1.0-6.zip'
Content type 'application/zip' length 36011 bytes (35 KB)
downloaded 35 KB
trying URL 'http://cran.mirror.garr.it/mirrors/CRAN/bin/windows/contrib/3.2/brew_1.0-6.zip'
Content type 'application/zip' length 104709 bytes (102 KB)
downloaded 102 KB
trying URL 'http://cran.mirror.garr.it/mirrors/CRAN/bin/windows/contrib/3.2/httr_0.6.1.zip'
Content type 'application/zip' length 388330 bytes (379 KB)
downloaded 379 KB
trying URL 'http://cran.mirror.garr.it/mirrors/CRAN/bin/windows/contrib/3.2/RCurl_1.95-4.6.zip'
Content type 'application/zip' length 2703282 bytes (2.6 MB)
downloaded 2.6 MB
trying URL 'http://cran.mirror.garr.it/mirrors/CRAN/bin/windows/contrib/3.2/memoise_0.2.1.zip'
Content type 'application/zip' length 16861 bytes (16 KB)
downloaded 16 KB
trying URL 'http://cran.mirror.garr.it/mirrors/CRAN/bin/windows/contrib/3.2/whisker_0.3-2.zip'
Content type 'application/zip' length 64626 bytes (63 KB)
downloaded 63 KB
trying URL 'http://cran.mirror.garr.it/mirrors/CRAN/bin/windows/contrib/3.2/evaluate_0.7.zip'
Content type 'application/zip' length 36884 bytes (36 KB)
downloaded 36 KB
trying URL 'http://cran.mirror.garr.it/mirrors/CRAN/bin/windows/contrib/3.2/rstudioapi_0.3.1.zip'
Content type 'application/zip' length 27315 bytes (26 KB)
downloaded 26 KB
trying URL 'http://cran.mirror.garr.it/mirrors/CRAN/bin/windows/contrib/3.2/jsonlite_0.9.16.zip'
Content type 'application/zip' length 1009930 bytes (986 KB)
downloaded 986 KB
trying URL 'http://cran.mirror.garr.it/mirrors/CRAN/bin/windows/contrib/3.2/roxygen2_4.1.1.zip'
Content type 'application/zip' length 598652 bytes (584 KB)
downloaded 584 KB
trying URL 'http://cran.mirror.garr.it/mirrors/CRAN/bin/windows/contrib/3.2/devtools_1.7.0.zip'
Content type 'application/zip' length 309378 bytes (302 KB)
downloaded 302 KB
package ‘mime’ successfully unpacked and MD5 sums checked
package ‘R6’ successfully unpacked and MD5 sums checked
package ‘bitops’ successfully unpacked and MD5 sums checked
package ‘brew’ successfully unpacked and MD5 sums checked
package ‘httr’ successfully unpacked and MD5 sums checked
package ‘RCurl’ successfully unpacked and MD5 sums checked
package ‘memoise’ successfully unpacked and MD5 sums checked
package ‘whisker’ successfully unpacked and MD5 sums checked
package ‘evaluate’ successfully unpacked and MD5 sums checked
package ‘rstudioapi’ successfully unpacked and MD5 sums checked
package ‘jsonlite’ successfully unpacked and MD5 sums checked
package ‘roxygen2’ successfully unpacked and MD5 sums checked
package ‘devtools’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\ex3446\AppData\Local\Temp\RtmpOYDKSd\downloaded_packages
有任何建议吗?
install.packages()
时,默认安装到我的用户AppData文件夹中。这可能与你的R设置有关。 - Alex A.