错误:“没有名为……的包";并尝试使用 install.packages 来解决它 [英] Error: "there is no package called ..." and trying to use install.packages to solve it

查看:84
本文介绍了错误:“没有名为……的包";并尝试使用 install.packages 来解决它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试下载不同的软件包时,我在大学计算机上的 R studio 给我一个错误,而当我在大学服务器上使用我的笔记本电脑时,我没有收到这个错误.因此,我不认为存在某种代理/服务器问题.

图书馆(阅读器)库(readr)中的错误:没有名为readr"的包

我也尝试使用 R.exe 程序下载软件包或下载其他软件包,但它给了我同样的错误.

在网上找了解决办法,找到了这个脚本:

install.packages('readr', dependencies = TRUE, repos='http://cran.rstudio.com/')

但它下载了许多不同的包:

我想知道 RStudio 给我这个错误的原因以及当我尝试使用 install.packages 下载 readr 包时发生了什么?

解决方案

库错误(readr):没有名为readr"的包

这意味着您的计算机上没有安装包 readr.

然后你用

安装了它

install.packages('readr', dependencies = TRUE, repos='http://cran.rstudio.com/')

哪个好.大多数包不是独立的",它们也使用其他包,称为依赖项.由于您使用了默认的 dependencies = TRUE,所有依赖项(及其依赖项)也已安装.

您可以查看 readr 的 CRAN 页面:https://CRAN.R-project.org/package=readr 以查看其依赖项(Depends"或Imports"字段中的任何内容都是必需的).当然,您还需要这些依赖项的依赖项等等.既然 readr 与其依赖项一起安装了,您可以运行 library(readr) 来加载它.>

The R studio I have in my university computer gives me an error when I try to download different packages, whereas when I'm with my laptop in the university server, I don't get this error. Because of this, I don't think that there is some kind of a proxy/server problem.

library(readr)
Error in library(readr) : there is no package called 'readr'

I also tried to download the package using R.exe program or download other packages and it gave me the same error.

After looking for a solution in the internet, I found this script:

install.packages('readr', dependencies = TRUE, repos='http://cran.rstudio.com/')

But it downloaded many different packages:

I would like to know the reason why RStudio gives me this error and what happened when I tried to download readr package using install.packages?

解决方案

Error in library(readr) : there is no package called 'readr'

This means that you don't have the package readr installed on your computer.

You then installed it with

install.packages('readr', dependencies = TRUE, repos='http://cran.rstudio.com/')

which is good. Most packages are not "stand-alone", they use other packages too, called dependencies. Because you used the default dependencies = TRUE, all the dependencies (and their dependencies) were also installed.

You can look at the CRAN page for readr: https://CRAN.R-project.org/package=readr to see its dependencies (anything in the "Depends" or "Imports" fields is required). And of course you need the dependencies of those dependencies, etc. Now that readr is installed along with its dependencies, you can run library(readr) to load it.

这篇关于错误:“没有名为……的包";并尝试使用 install.packages 来解决它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆