lib 未指定 &加载命名空间错误 [英] lib unspecified & Error in loadNamespace

查看:28
本文介绍了lib 未指定 &加载命名空间错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 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 不断抛出加载命名空间错误.通过安装包,自动安装所有依赖,解决这个问题.

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"))

这篇关于lib 未指定 &amp;加载命名空间错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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