简体   繁体   English

未指定 lib 和 loadNamespace 中的错误

[英]lib unspecified & Error in loadNamespace

I had everything working with R and RStudio, but then I moved the folders when cleaning up my computer directories & files.我在 R 和 RStudio 上完成了所有工作,但是在清理计算机目录和文件时我移动了文件夹。 Now I'm getting the error message below.现在我收到以下错误消息。

Should R and RStudio be installed under Program Files or Program Files (x86) ? R 和 RStudio 应该安装在Program Files还是Program Files (x86) Should I have two libPaths ?我应该有两个libPaths吗?

install.packages("C:/Users/kevin/Downloads/fpp_0.5.zip", repos = NULL)
## Warning in install.packages :
##  package ‘C:/Users/kevin/Downloads/fpp_0.5.zip’
## is not available (for R version 3.0.0)
## Installing package into ‘C:/Users/kevin/Documents/R/win-library/3.0’
## (as ‘lib’ is unspecified)
## package ‘fpp’ successfully unpacked and MD5 sums checked
library("fpp", lib.loc="C:/Users/kevin/Documents/R/win-library/3.0")
Loading required package: forecast
## Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
##   there is no package called ‘colorspace’
## Error: package ‘forecast’ could not be loaded

When you install the package using the RStudio package installer or directly from CRAN, it doesn't install the dependencies ("fracdiff", "Rcpp", "RcppArmadillo" and "colorspace") and hence, R keeps throwing the load namespace error.当您使用 RStudio 软件包安装程序或直接从 CRAN 安装软件包时,它不会安装依赖项(“fracdiff”、“Rcpp”、“RcppArmadillo”和“colorspace”),因此,R 不断抛出加载命名空间错误。 Installing the package through, automatically installs all the dependencies and solves this problem.通过安装包,自动安装所有依赖,解决这个问题。

install.packages("forecast",
                 repos = c("http://rstudio.org/_packages",
                           "http://cran.rstudio.com"))

The last time I encountered a very similar problem, I used this code which I got somewhere: install.packages("package's name", repos=c("http://rstudio.org/_packages", "http://cran.rstudio.com")) simply put your package's name in the quotation marks.上次我遇到非常相似的问题时,我使用了我在某处找到的这段代码: install.packages("package's name", repos=c("http://rstudio.org/_packages", "http://cran.rstudio.com"))只需将您的软件包名称放在引号中即可。 Hope this helps.希望这可以帮助。

用这个:

install.packages("colorspace", dependencies = TRUE)

I ran into this problem.我遇到了这个问题。 It turned out that my .Rprofile had calls to a package that was not installed.结果是我的.Rprofile调用了一个没有安装的包。 Removing these lines allowed installation to proceed normally.移除这些线路允许安装正常进行。

I got this error while installing the library 'tidyverse'.安装库“tidyverse”时出现此错误。 Removed the error by upgrading R from v3.4 to v3.6通过将 R 从 v3.4 升级到 v3.6 消除了错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 r 'lib' 中的错误安装包未指定 - error install packages in r ‘lib’ is unspecified loadNamespace Rstudio中的错误 - Error in loadNamespace Rstudio loadNamespace 中的错误(j &lt;- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): - Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 错误:package 或 loadNamespace 中“EGSEA”的命名空间加载失败(i,c(lib.loc,.libPaths()),versionCheck = vI[[i]]): - Error: package or namespace load failed for ‘EGSEA’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): loadNamespace中的库(WGCNA)错误 - library(WGCNA) Error in loadNamespace 错误“.onLoad 在 'tcltk' 的 loadNamespace() 中失败” - Error ".onLoad failed in loadNamespace() for 'tcltk'" 对于Copula包,R中的loadNamespace出错 - Error in loadNamespace in R for Copula package 在loadNamespace(j &lt;-i [[1L]],c(lib.loc,.libPaths()),versionCheck = vI [[j]])中,“ car”的“ Rcmdr”错误加载失败: - “Rcmdr” error load failed for ‘car’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): 安装 R devtools 时出错:`loadNamespace 中的错误` - Error installing R devtools: `Error in loadNamespace` loadNamespace(name)中的错误:没有名为“ Rcompression”的软件包 - Error in loadNamespace(name) : there is no package called ‘Rcompression’
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM