未指定的& loadNamespace中的错误 [英] lib unspecified & Error in loadNamespace
问题描述
我可以使用R和RStudio进行所有操作,但是随后在清理计算机目录时移动了文件夹.文件.现在,我收到以下错误消息.
I had everything working with R and RStudio, but then I moved the folders when cleaning up my computer directories & files. Now I'm getting the error message below.
R和RStudio是否应安装在Program Files
或Program Files (x86)
下?我应该有两个libPaths
吗?
Should R and RStudio be installed under Program Files
or Program Files (x86)
? Should I have two 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
推荐答案
使用RStudio软件包安装程序或直接从CRAN安装软件包时,它不会安装依赖项("fracdiff","Rcpp","RcppArmadillo" "和"colorspace"),因此R会不断抛出load名称空间错误.通过自动安装软件包,将自动安装所有依赖项并解决此问题.
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. 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"))
这篇关于未指定的& loadNamespace中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!