edited 2018-04-26: Changed title as per comments, this is a broader issue with R3.5.0
original:
I'm pretty new to R, and not savvy with all of it's joys.
I've just had my works computer upgrade (result!) to windows 10 with java version 8.1 64bit; r 3.5.0, and r studio 1.1.447.
My code is no longer loving qdap package. It claims to install but won't library in.
CODE:
`pkg <- c("rJava","rmarkdown", "tidyverse","ggplot2", "knitr", "tm", "RColorBrewer", "wordcloud", "qdapDictionaries","qdapRegex", "qdapTools","qdap")
new.pkg <- pkg[!(pkg %in% installed.packages())]
if (length(new.pkg)) {
install.packages(new.pkg, repos = "http://cran.rstudio.com")
}
library(qdap)`
output:
`Loading required package: qdapTools
Error: package or namespace load failed for ‘qdapTools’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘data.table’
Error: package ‘qdapTools’ could not be loaded`
googling suggested I needed to modify the dependencies part, which threw this one
`install.packages(new.pkg, repos = "http://cran.rstudio.com", dependencies = TRUE)
also installing the dependencies ‘data.table’, ‘koRpus’, ‘lda’, ‘proxy’, ‘SnowballC’
Package which is only available in source form, and may need compilation of C/C++/Fortran:
‘data.table’
These will not be installed`
Any thoughts (and fixes!) much appreciated. sorry for obvs noobie question.
I am by no means an expert here, but found a fix for this exact same problem earlier today!
Download and install the most recent version of RTools from the following link:
https://cran.r-project.org/bin/windows/Rtools/.
After restarting R, run this code:
install.packages("data.table")
When the error message arises, you should see a pop-up asking if you'd like to attempt to install the package from its source. Click 'yes' and it should install correctly!
The GitHub for data.table has directions to a daily-build windows binary of data.table https://github.com/Rdatatable/data.table/wiki/Installation
following the instructions on this and installing from the zip file now works. note that a few days ago it did not. Hopefull "normal" install practices will work soon too.
Related
I have installed ggplot2 in R but when I try to load it, R gives this ERROR message:
library(ggplot2)
Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): namespace ‘rlang’ 0.4.6 is already loaded, but >= 0.4.7 is required
What should I do?
Thanks in advance.
Install the full tidyverse package, it will load all graphics dependencies include gglot2 and its dependencies too.
install.packages("tidyverse")
As mentioned here:
https://community.rstudio.com/t/i-cant-load-ggplot2-in-my-library-in-r-version-3-4-3/6466
I am working on WINDOWS OS and I had same problems with loading ggplot2 and other libraries. I tried to install it like it was suggested in other threads, but it didn't solve the problem. I found some similar issues in other topics, and i figured out that my Rstudio console wanted to have fresh a toolchain bundle called Rtools. It can be downloaded from CRAN REP.
You have to pick appripiote version for your Rengine version. If you do not know what version of R you have, you have to simple type R.version in console, and then download proper version of Rtools. After that, i updated every libraries in Rstudio. ggplot2, tidyverse and many other are working properly from that time
I hope that it could help somebody :)
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 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)
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:
Uninstall R
Reinstall R
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
Note that the above output says "Warning" but actually, it is an indication of failure to install the Rcpp package successfully within the repository. I then used the Tools-->Install packages--> From ZIP file and pointed to the location of the "downloaded binary packages" in the message above -
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)
Faced same issue and solved by :
remove.packages("ggplot2")
install.packages('ggplot2', dependencies = TRUE)
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.
when you see
Do you want to install from sources the package which needs compilation? (Yes/no/cancel)
answer no
Try this:
install.packages('Rcpp')
install.packages('ggplot2')
install.packages('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
reinstalling "tidyverse".
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 tried all the listed solutions above but nothing worked.
This is what worked for me.
Look at the complete error message which you get when you use library(ggplot2).
It lists a couple of packages which are missing or have errors.
Uninstall and reinstall them.
ggplot should work now with a warning for version.
These steps work for me:
Download the Rcpp manually from WebSite
(https://cran.r-project.org/web/packages/Rcpp/index.html)
unzip the folder/files to "Rcpp" folder
Locate the "library" folder under R install directory Ex:
C:\R\R-3.3.1\library
Copy the "Rcpp" folder to Library folder.
Good to go!!!
library(Rcpp)
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.
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.
Sorry for joining the party late, You can install any package in RStudio by downloading the zip file from the CRAN website and running the below snippet in the console,
install.packages('~/Downloads/Rcpp_1.0.8.tgz', repos = NULL, type = 'source')
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
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"))
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.
Use this:
install.packages("colorspace", dependencies = TRUE)
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.
I got this error while installing the library 'tidyverse'. Removed the error by upgrading R from v3.4 to v3.6
I was trying to import the package "ggplot2", which I already downloaded, and can't do it through library(ggplot2) command.
It gives me the following error message:
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’
Thanks in advance!
I would run,
install.packages("ggplot2", dependencies = TRUE)
This reinstall ggplot2 and "install uninstalled packages which these packages depend" (from ?install.packages).
Try seeing where your libraries are being downloaded + installed to (not sure what the defaults are on Windows), and then see if R knows where to find them by using the .libPaths() command.
If not, add the directory where they are to your R environment as described in [this post] (RStudio can't find my library on startup) and see whether that helps.
.Library.site <- "\\\\gregorp.homedir.nebula.washington.edu/homes/R/win-library/2.15"
If it helps (but only if it does!) add it to your .Rprofile.
I've finally managed to make gglopt2 work! I just downloaded "Rcpp" and then everything was fine (don't know why it didn't work last time...). Thank you all for your help! ;) Best wishes.
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 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)
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:
Uninstall R
Reinstall R
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
Note that the above output says "Warning" but actually, it is an indication of failure to install the Rcpp package successfully within the repository. I then used the Tools-->Install packages--> From ZIP file and pointed to the location of the "downloaded binary packages" in the message above -
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)
Faced same issue and solved by :
remove.packages("ggplot2")
install.packages('ggplot2', dependencies = TRUE)
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.
when you see
Do you want to install from sources the package which needs compilation? (Yes/no/cancel)
answer no
Try this:
install.packages('Rcpp')
install.packages('ggplot2')
install.packages('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
reinstalling "tidyverse".
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 tried all the listed solutions above but nothing worked.
This is what worked for me.
Look at the complete error message which you get when you use library(ggplot2).
It lists a couple of packages which are missing or have errors.
Uninstall and reinstall them.
ggplot should work now with a warning for version.
These steps work for me:
Download the Rcpp manually from WebSite
(https://cran.r-project.org/web/packages/Rcpp/index.html)
unzip the folder/files to "Rcpp" folder
Locate the "library" folder under R install directory Ex:
C:\R\R-3.3.1\library
Copy the "Rcpp" folder to Library folder.
Good to go!!!
library(Rcpp)
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.
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.
Sorry for joining the party late, You can install any package in RStudio by downloading the zip file from the CRAN website and running the below snippet in the console,
install.packages('~/Downloads/Rcpp_1.0.8.tgz', repos = NULL, type = 'source')