• Register
0 votes
498 views

Problem :

My R and RStudio were working perfectly fine till I moved the folders while cleaning up my directories & files and now I am facing the following error message :

Should I reinstall the R and RStudio under the Program Files or Program Files (x86)? Also is it good practice to have two libPaths?

install.packages("C:/Users/alecxe/Downloads/fpp_0.5.zip", repos = NULL)
## Warning in install.packages :
## package ‘C:/Users/alecxe/Downloads/fpp_0.5.zip’
## is not available (for R version 3.0.0)
## Installing package into ‘C:/Users/alecxe/Documents/R/win-library/3.0’
## (as ‘lib’ is unspecified)
## package ‘fpp’ successfully unpacked and MD5 sums checked
library("fpp", lib.loc="C:/Users/alecxe/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
6 5 3
7,540 points

2 Answers

0 votes

Solution :

Generally when you try to install the package using the RStudio package installer or directly from CRAN, it will not install the following dependencies "fracdiff", "Rcpp", "RcppArmadillo" and "colorspace" and so the R keeps showing the load namespace error. So to avoid this error you should install the package through, automatically installs all your dependencies and solves this issue.

install.packages("forecast",repos = c("http://rstudio.org/_packages",
 "http://cran.rstudio.com"))
OR
Use following command to resolve the issue::
install.packages("colorspace", dependencies = TRUE)
9 7 4
38,600 points
0 votes

Solution:

At the time 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 therefore, R keeps throwing the load namespace error. Installing the package through, automatically installs all the dependencies and solves this issue.

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

The last time I encountered a very similar issue, using this code : install.packages("package's name", repos=c("http://rstudio.org/_packages", "http://cran.rstudio.com"))

Use this:

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

Important Note:

 There is to first install ggplot2 explicitly installing all dependencies

install.packages(
   "ggplot2",
   repos = c("http://rstudio.org/_packages",
   "http://cran.rstudio.com")
)
#> You may also find it useful to restart R,
#> In RStudio, that's the menu Session >> Restart R

library(ggplot2)

 

10 6 4
31,120 points

Related questions

1 vote
1 answer 104 views
104 views
Problem: I have some knowledge about R and Rstudio. Currently I am trying to install the package known as dplyr but it constantly shows me the below error: Error in install.packages : missing value where TRUE/FALSE needed. Please find below my console history for your ... very limited knowledge about R and Rstudio so I am unable to fix it. I am still facing the same error please guide me.
asked May 26 Martin K 6.6k points
0 votes
1 answer 595 views
595 views
Problem : I am new to npm and now I am facing strange looking below error &ldquo;Error: EACCES: permission denied, access '/usr/local/lib/node_modules'&rdquo; Detailed error as below: npm ERR! path /usr/local/lib/node_modules npm ERR! code EACCES npm ERR! errno -13 npm ... code: 'EACCES', npm ERR! syscall: 'access', npm ERR! path: '/usr/local/lib/node_modules' } Have somebody fixed this before?
asked Feb 20 mphil 2.3k points
1 vote
1 answer 39 views
39 views
Problem : I am very new to R. Currently I need to embed RInside to the required application on the windows 7 64-bit Operating system but if I try to initialize the RInside as shown below: Rin = new RInside(argc, argv); I often face the message as shown below for ... done lot of research to fix above R error but unable to fix it. So looking for R expert who can help in quick fixing above error.
asked May 5 stewart 4k points
0 votes
1 answer 1.3K views
1.3K views
Problem : I have been facing below error message and traceback: Error in FUN(X[[i]], ...) : only defined on the data frame with all numeric variables 5 stop("only defined on the data frame with all numeric variables") 4 FUN(X[[i]], ...) 3 lapply(args, ... .numeric(data[good,]) But now I get the different error message back as below : "Error: (list) object cannot be coerced to type 'double'"
asked Dec 16, 2019 alecxe 7.5k points