Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. Now I'm getting the error message below.

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
like image 778
kevin c Avatar asked May 11 '13 20:05

kevin c


People also ask

Why is Lib unspecified in R?

It looks like you installed the package in your library but did not load it into the environment with the library() function. You install packages once and then load the ones you want to use for each r session.


1 Answers

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"))
like image 195
DevKhokhar Avatar answered Oct 02 '22 03:10

DevKhokhar