rrtools

object ‘wrap_plots’ is not exported by 'namespace:patchwork'


I'm trying to download the package "Seurat" in R, the package is installed and it's now in my list of packages.

** testing if installed package keeps a record of temporary installation path
* DONE (patchwork)

The downloaded source packages are in
    ‘C:\Users\parnian\AppData\Local\Temp\RtmpAVgSd8\downloaded_packages’

But when I try to call it (library(Seurat)) I get the following error:

> library(Seurat)
Error: package or namespace load failed for ‘Seurat’:
 object ‘wrap_plots’ is not exported by 'namespace:patchwork'

I read the similar questions and manually installed "patchwork":

 > install.packages("patchwork")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/parnian/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)

R also tells me to install Rtools whhich I have, but when I follow these commands:

> writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron")

there are no more folders in rtools40/home . I don't get the usr\bin... in the address above. but when I want to verify that make can be found (Sys.which("make")), I get this:

> Sys.which("make")
make 
  ""

Also the downloaded packages of Seurat are saved in a location that doesn't even exist in my computer! How is that possible? How can I fix this?

Thank you


Solution

  • I was having the same problem. Turns out there are two 'patchwork' packages in R somehow. I got a hint that this was the problem from the answer provided here (https://github.com/satijalab/seurat/issues/2818)

    The other patchwork has the current update of 2.4. So what you should do is uninstall the current patchwork and use

    devtools::install_github("thomasp85/patchwork")

    I did this and it fixed the problem!