R包安装问题

Jag*_*h R 2 r

我无法在 R 中安装任何软件包。我尝试了从 3.2.2 到 3.2.4(修订版)的所有 R 版本,但出现了相同的错误。当我连接到我的大学防火墙时,这对我来说似乎是一个代理问题。当我连接到家庭网络时,我能够安装这些软件包。您能指导我解决此问题吗?\n以下是错误消息

\n\n
> chooseCRANmirror()\nError in download.file(url, destfile = f, quiet = TRUE) : \n  cannot open URL \'https://cran.r-project.org/CRAN_mirrors.csv\'\nIn addition: Warning message:\nIn download.file(url, destfile = f, quiet = TRUE) :\n  InternetOpenUrl failed: \'The server name or address could not be resolved\'\n> install.packages("ggplot2")\nInstalling package into \xe2\x80\x98C:/Users/HP/Documents/R/win-library/3.2\xe2\x80\x99\n(as \xe2\x80\x98lib\xe2\x80\x99 is unspecified)\nWarning: unable to access index for repository https://cran.rstudio.com/src/contrib\nWarning: unable to access index for repository \nWarning: unable to access index for repository \nWarning: unable to access index for repository \nWarning message:\npackage \xe2\x80\x98ggplot2\xe2\x80\x99 is not available (for R version 3.2.2)\n
Run Code Online (Sandbox Code Playgroud)\n

Him*_*Rai 5

这与我在安装任何软件包时也遇到的问题相同。我认为主要原因是你的 R 会话无法连接到 Cran 服务器上的文件路径。

我所做的只是手动访问 Cran 网站并下载该特定软件包的 Windows 版本。现在解压缩文件并将文件夹手动粘贴到 R 的库文件夹中。

库文件夹路径将类似于:C:\Program Files\R\R-3.2.3\library

现在转到 R 控制台并使用库(包名称)加载它。您现在可以使用您的包了。