lib unspecified & Error in loadNamespace
Asked Answered
I

5

20

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
Infirmity answered 11/5, 2013 at 20:39 Comment(0)
D
30

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"))
Duren answered 9/10, 2013 at 7:9 Comment(0)
S
11

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. Hope this helps.

Sanford answered 18/6, 2013 at 5:41 Comment(0)
C
8

Use this:

install.packages("colorspace", dependencies = TRUE)
Cratch answered 8/12, 2016 at 10:48 Comment(0)
U
1

I ran into this problem. It turned out that my .Rprofile had calls to a package that was not installed. Removing these lines allowed installation to proceed normally.

Unfriended answered 26/10, 2015 at 20:31 Comment(0)
L
0

I got this error while installing the library 'tidyverse'. Removed the error by upgrading R from v3.4 to v3.6

Lettering answered 19/11, 2020 at 8:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.