3
votes

I would like to install the package plotly in RStudio and got a error message.

install.packages("~/Desktop/plotly_4.5.2.tar.gz", repos = NULL, type = "source")

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : namespace ‘Rcpp’ 0.12.3 is already loaded, but >= 0.12.7 is required.

packageVersion('Rcpp')
I checked the version of Rcpp and it is 0.12.13 version, but the loaded version is 0.12.3 when installing the package. Is there any way to load the 0.12.13 version from library path when install the package?

4
try install.packages("Rcpp")Al14
How do you know you have both 0.12.13 and 0.12.3 installed?r2evans
2 Rcpp packages in 2 different library path. Rcpp is 0.12.3 in library 1 and is 0.12.13 in library 2.Trace

4 Answers

4
votes

I also faced a similar issue. I restarted the R session and reinstalled both packages.

install.packages("Rcpp")
install.packages("plotly")

In my case, I was not able to load dplyr package. So, first I installed Rcpp package and then installed dplyr package. This solved my problem.

0
votes

I use devtools to install the Rcpp:

devtools::install_github("RcppCore/Rcpp")

Then the version of Rcpp has changed:

> packageVersion("Rcpp")
[1] ‘1.0.1’

And I load the tidyverse and see it is successfull.

> library(tidyverse)
── Attaching packages ─────────────────────────────────────── tidyverse 1.2.1 ──
✔ ggplot2 3.0.0       ✔ purrr   0.2.5  
✔ tibble  2.1.1       ✔ dplyr   0.8.0.1
✔ tidyr   0.8.1       ✔ stringr 1.3.1  
✔ readr   1.1.1       ✔ forcats 0.3.0  
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
0
votes

sometimes you just did not restart your R studio after update. For example,

update.packages(ask=F)

After this, you should restart your R studio. Then

devtools::install_github("RcppCore/Rcpp")
0
votes

I had a similar issue. The idea is that you need to first update that package of issue and then reload it!

install.packages("Rcpp")

library(Rcpp)

Don't miss the second line. For me, installing an updated version did not solve the problem till I reload the library.