R: Problems with unloadNamespace (package) when installing the package

I made an R package called TRIMmaps and tried to install it using the command

R CMD INSTALL TRIMmaps_v1.12.0 

I received the following error message:

 Error in unloadNamespace(package) : namespace 'Rcpp' is imported by 'plyr' so cannot be unloaded Error in library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc) : "Rcpp" version 0.11.2 cannot be unloaded. 

I really need the plyr package, because when I delete it, I get a message:

 Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : there is no package called 'plyr' 

I uninstalled both plyr and Rcpp and installed them again. My current version of Rcpp now 0.11.5, but when I try to install the TRIMmaps package again, I get the same error message as above, including the line "Rcpp" version 0.11.2 cannot be unloaded . Although I removed the old version of Rcpp and replaced it with 0.11.5, there is still a problem with 0.11.2.

How can i solve this? Any hints are welcome.

+7
namespaces installation r package
source share
1 answer

I get a similar error. Minimum conditions for reproduction:

  • Depend in package x (in my case reshape )
  • In your vignette, download the package y (in my case plyr ), which also imports or depends on x .

A vignette builds fine if you create it outside of the assembly or package check, but it produces an error, which you indicate otherwise. The error is also a version of R and possibly site-specific, as it leaves with R 3.2.0 when trying to create a package on another machine.

+5
source share

All Articles