I am not able to open install the ggplot2 and data.table packages. It gives me the following error (example for ggplot2)
> library(ggplot2)
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘Rcpp’
Error: package or namespace load failed for ‘ggplot2’
I was able to work fine with these 2 packages before I closed my R session. Now it shows me this error each time I try to run it.
I have also tried to remove and re-install it, but without success.
remove.packages(c("ggplot2", "data.table"))
install.packages('ggplot2', dep = TRUE)
install.packages('data.table', dep = TRUE)
I am not sure what's wrong
This question is related to
r
ggplot2
data.table
I had the same problem with the package "tidyverse". I solved the problem with 1. uninstalling the package "Rcpp" and "tidyverse" 2. reinstalling "Rcpp" and answering the following questions during the installation process:
Do you want to install from sources the package which needs compilation? (Yes/no/cancel)
with
no
I tried the steps mentioned in the earlier posts but without any success. However, what worked for me was uninstalling R completely and then deleting the R folder which files in the documents folder, so basically everything do with R except the scripts and work spaces I had saved. I then reinstalled R and ran
remove.packages(c("ggplot2", "data.table"))
install.packages('Rcpp', dependencies = TRUE)
install.packages('ggplot2', dependencies = TRUE)
install.packages('data.table', dependencies = TRUE)
This rather crude method somehow worked for me.
I had this same problem, but when running in a jupyter R notebook in an Anaconda environment.
The problem presented in such a way that any R notebook opened would instantly die and would not allow cell execution. The error would show up with each failed automated attempt to start the kernel:
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘Rcpp’
To solve this, I ran as admin/sudo: conda install -c r r-rcpp
, restarted the kernel, and everything was back to normal.
These steps work for me:
Good to go!!!
library(Rcpp)
library(ggplot2)
I also faced the same problem and
remove.packages(c("ggplot2", "data.table"))
install.packages('Rcpp', dependencies = TRUE)
install.packages('ggplot2', dependencies = TRUE)
these commands did not work for me. What I found was that it was showing a warning message that it could not move temporary installation C:\Users\User_name\Documents\R\win-library\3.3\abcd1234\Rcpp
to C:\Users\User_name\Documents\R\win-library\3.3\Rcpp
.
I downloaded the Rcpp zip file from the link given and unziped it and copied it inside C:\Users\User_name\Documents\R\win-library\3.3
and then
library(Rcpp)
library(ggplot2)
worked. I did not have to uninstall R. Hope this helps.
After a wild goose chase with tons of Google searches and burteforce attempts, I think I found how to solve this problem.
Steps undertaken to solve the problem:
Install ggplot with the dependencies argument to install.packages set to TRUE
install.packages("ggplot2",dependencies = TRUE)
The above step still does NOT include the Rcpp dependency so that has to be manually installed using the following command
install.packages("Rcpp")
However, while the above command successfully downloads Rcpp, for some reason, it fails to explode the ZIP file and install it in my R's library folder citing the following error:
package ‘Rcpp’ successfully unpacked and MD5 sums checked Warning in install.packages : unable to move temporary installation ‘C:\Root_Prgs\Data_Science_SW\R\R-3.2.3\library\file27b8ef47b6d\Rcpp’ to ‘C:\Root_Prgs\Data_Science_SW\R\R-3.2.3\library\Rcpp’
The downloaded binary packages are in C:\Users\MY_USER_ID\AppData\Local\Temp\Rtmp25XQ0S\downloaded_packages
C:\Users\MY_USER_ID\AppData\Local\Temp\Rtmp25XQ0S\downloaded_packages\Rcpp_0.12.3.zip
This led to successful installation of Rcpp in my R\R-3.2.3\library folder, thereby ensuring that Rcpp is now available when I attempt to load the library for ggplot2. I could not do this step in the past because my previous installation of R would throw error stating that Rcpp cannot be imported. However, the same command worked after I uninstalled and reinstalled R, which is ODD.
install.packages("C:/Users/MY_USER_ID/AppData/Local/Temp/Rtmp25XQ0S/downloaded_packages/Rcpp_0.12.3.zip", repos = NULL, type = "win.binary") package ‘Rcpp’ successfully unpacked and MD5 sums checked`
I was finally able to load the ggplot2 library successfully.
library(ggplot2)
For me, i had to uninstall R from brew brew uninstall --force R
and then head over to the R website and download and install it from there.
This solved the issue:
remove.packages(c("ggplot2", "data.table"))
install.packages('Rcpp', dependencies = TRUE)
install.packages('ggplot2', dependencies = TRUE)
install.packages('data.table', dependencies = TRUE)
Faced same issue and solved by :
remove.packages("ggplot2")
install.packages('ggplot2', dependencies = TRUE)
when you see
Do you want to install from sources the package which needs compilation? (Yes/no/cancel)
answer no
I tried all the listed solutions above but nothing worked. This is what worked for me.
Try this:
install.packages('Rcpp')
install.packages('ggplot2')
install.packages('data.table')
Source: Stackoverflow.com