Revolution R Enterprise with R version 3.2.2 and caret package - r

I am using Revolution R Enterprise with R version 3.2.2 (2015-08-14)
when I am trying to installed library(caret) I got this error
library(caret)
Loading required package: ggplot2
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘Rcpp’
In addition: Warning messages:
1: package ‘caret’ was built under R version 3.2.5
2: package ‘ggplot2’ was built under R version 3.2.4
Error: package ‘ggplot2’ could not be loaded
please help me
I tried many things and every things but I still have this error

So, that warning is pretty common with R packages. It is just a disclosure of what version the package was tuned to when it was created. That does not mean the package did not install properly.So there are a few things that I do when this happens (and it happened to me at work today with the sp mapping package).
If you are in RStudio, use the tools to update all packages as well updating R itself, save everything in your script, close it up. Restart you entire computer.
Reinstall the packages you need with install.packages("packagename", dependencies= TRUE). If a package is dependent on another package, then you will catch it here.
Then go back through the console and see all of the dependent package names that installed with your new package and update those with dependencies=TRUE as well. It is possible the Rcpp is installed but needs another package to support your target package.
I would again properly quit R or RStudio and then reboot the computer again.
I know it seems like overkill, but it has worked miracles for me on many occasions. You need to start all the way at the beginning to make it happen.

Related

Problem in loading ggplot2 in R version 4.0

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 :)

Errors installing/loading package ‘adespatial’

I am trying to run the dbmem function on a large dataset using the adespatial package, but cannot get it to install. When I run install.package("adespatial), I get this message:
package ‘adespatial’ is available as a source package but not as a binary.
Why can't I install this package as a binary and how do I go about getting this package installed on my Mac (OS sierra version 10.12.6). I am running R studio with R version 3.1.2
Update
I also tried running
install.packages("adespatial",type = "source")
however when I try to load the library it still says the library is not found. There were also many errors in the install. I updated my version of R to 3.4.4 and now it will install with a few errors, but the library still will not come up.
When I attempt to load the library (library(adespatial)), I receive this error:
Error: package or namespace load failed for ‘adespatial’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘curl’
Bit hard to replicate your problem, but try to install curl; either the R package:
install.packages("curl")
or directly on your OS (can't help there, sorry, never had an OS).
Anyway, if package installation fails in R, it throws an (or more) error message(s). In your case, they will point to missing packages. Rerun install.packages("adespatial") and see there.

Unable to install new R packages in DSX Desktop

I've just installed DSX Desktop with RStudio. I'm unable to load new packages, e.g. lubridate, and get the error below. If I check for package updates, I get the message "all packages are up-to-date", but the error below suggests it needs a newer version of Rcpp.
installing to /user-home/_global_/R/lubridate/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace ‘Rcpp’ 0.12.9.2 is already loaded, but >= 0.12.13 is required
ERROR: lazy loading failed for package ‘lubridate’
* removing ‘/user-home/_global_/R/lubridate’
Warning in install.packages :
installation of package ‘lubridate’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpIV4HWl/downloaded_packages’
I tried install.packages("Rcpp") which returned the message:
Error in unloadNamespace(pkg_name) :
namespace ‘Rcpp’ is imported by ‘httpuv’, ‘reshape2’, ‘tidyr’, ‘bindrcpp’, ‘tibble’, ‘htmltools’, ‘dplyr’, ‘plyr’ so cannot be unloaded
If I try remove.packages("Rcpp") or removing the packages above, I get the following message, and they remain in the Packages view.
Removing package from ‘/user-home/_global_/R’
(as ‘lib’ is unspecified)
Error in remove.packages : there is no package called ‘Rcpp’
Any advice please on how to proceed?
There seems to be a fundamental problem with RStudio. I encountered exactly the same problems you describe with the latest version (1.1.442). The problems are:
Packages viewed as out-of-date go into a loop when installing with a repeated error dialog box appearing.
The package version check refers out-of-date packages and will not install the current package versions showing on CRAN. This is due to RStudio pointing at a MRAN mirror that has old updates. This means that all packages stored there are out of date. You can see when the packages on MRAN were last updated here.
Removal of other packages (e.g. dependencies) doesn't work properly, and manual deletion of the folders doesn't solve the problem.
Inside Tools, Global options, Packages there is the ability to specify the mirror that should be used for package management. This doesn't seem to work.
I fixed my problem by going into R and performing a package update inside that. RStudio now uses the updated packages.
I have contacted RStudio about this and received the reply that they don't provide support for free versions of RStudio.
tl;dr: RStudio appears to be broken for updating packages. Use R itself for updates.
I was getting this error:
Windows 7, update.packages problem: “unable to move temporary installation”? Which I think was due to my antivirus, but not sure. MRAN version was 3.3.1 and this is what I would do to fix this error everytime I opened R-Studio and needed to install:
trace(utils:::unpackPkgZip, edit=TRUE)
# Edit line 142 - change Sys.sleep(2.5)
I was still having versioning issues with tidyverse, so looked around and decided to install the latest MRAN from Microsoft and that fixed all of my R-Studio versioning issues and install inssues. I had other issues where I was doing a work.
Version info:
Microsoft R Open 3.5.1
The enhanced R distribution from Microsoft
Default CRAN mirror snapshot taken on 2018-08-01.
Download Microsoft R Open 3.5.1

choroplethr package in R won't load

I am trying to load the choroplethr package in R and keep getting an error message that I can't troubleshoot or understand. If someone could please provide me with a workaround to fix this that would be appreciated.
install.packages("choroplethr")
install.packages("choroplethrMaps")
library(choroplethr)
library(choroplethrMaps)
Loading required package: acs
Loading required package: stringr
Loading required package: XML
Attaching package: acs
The following object is masked from package:base:
apply
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘htmlTable’
In addition: Warning messages:
1: package ‘choroplethr’ was built under R version 3.2.5
2: package ‘stringr’ was built under R version 3.2.5
3: package ‘XML’ was built under R version 3.2.5
Error: package or namespace load failed for ‘choroplethr’
Thank you,
Kelly
I am the package author and unfortunately I often have users report errors like this.
Technically, when you install an R package all of the packages needed to run that package are supposed to automatically get installed. In practice, however, that does not always happen. The key part of the first error message you report is this:
Error ... there is no package called ‘htmlTable’
In response to that error message I would simply manually install the htmlTable package and then reinstall choroplethr:
install.packages("htmlTable")
install.packages("choroplethr")
Reading the comments from your initial question it seems like you were able to get past this error message but then ran into another one. Again, the key part of that error message seems to be the following:
Error ... there is no package called ‘rlang’
I would address this error in the same way. Ie type:
install.packages("rlang")
install.packages("choroplethr")
Again, I have no idea why errors like this seem to sporadically occur when people try to install choroplethr (and presumably other packages as well). However, the fix that always seems to work is manually installing the package which R complains it cannot find.

Installing ggplot2 in R (v3.2.2); says it's installed but is unable to be found/used? [duplicate]

This question already has answers here:
How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning?
(18 answers)
Closed 7 years ago.
I'm having trouble installing the ggplot2 package in R. According to R-studio, I have the latest version installed; this is what it says when R studio first loads:
R version 3.2.2 (2015-08-14) -- "Fire Safety"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
I'm assuming this means I'm using the correct version. But then, when I try to install the ggplot2 package using the install.packages("ggplot2") command, I get the following error (had to post in pastebin because it contained links):
http://pastebin.com/deqn0vFw
It appears to be some kind of error with my internet connection (not sure how to fix it, googling didn't seem to give a concrete answer). After I got that error, I went ahead and just tried downloading the .zip file for ggplot2 from the official CRAN website. Then, in R-Studio I went ahead and went to Tools>Install Packages and just installed it from the .zip. Then, in the console it said
> install.packages("C:/Users/ralei/Downloads/ggplot2_1.0.1.zip", repos = NULL, type = "win.binary")
Installing package into ‘C:/Users/ralei/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
package ‘ggplot2’ successfully unpacked and MD5 sums checked
But then when I call the ggplot2 library using the library(ggplot2) I get the error:
> library(ggplot2)
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘digest’
After going ahead and installing the 'digest' package (again through the CRAN website), I got another error when I tried to load ggplot2.
> library(ggplot2)
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘gtable’
Error: package or namespace load failed for ‘ggplot2’
Can anybody explain to me what I'm doing wrong?
Thanks.
EDIT: This was marked as a duplicate to a "what to do if your package isn't available" error question but I don't see how my question is a duplicate of that -- I'm not getting the "package is unavailable" error since I can install it manually, but it seems that when I install ggplot2, the installation doesn't seem to 'stick'.
Try using running this code..
install.packages('ggplot2',dependencies = TRUE)
If you are still facing problem than make sure installing the dependencies individually ("plyr","digest","gtable","reshape2","scales","proto","MASS" etc) from the following website https://cran.rstudio.com/ and check whether the install file unpacked in the directory C:\Users\Sahidul.Islam\Documents\R\win-library\3.2.
If still not working than upgrade R software and all packages (package can be upgrade by clicking the "Packages"+"upgrade packages..." inside the menu bar in R Software.

Resources