Trace
Trace

Reputation: 71

R install package loaded namespace

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?

Upvotes: 7

Views: 53184

Answers (4)

RachelSunny
RachelSunny

Reputation: 1134

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.

Upvotes: 0

Wei_Du
Wei_Du

Reputation: 19

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

Upvotes: 1

Deng Fei
Deng Fei

Reputation: 11

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

Upvotes: 0

Sayali Sonawane
Sayali Sonawane

Reputation: 12609

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.

Upvotes: 8

Related Questions