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

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

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!

Related

R package bizdays cannot be installed

I have been using bizdays package for a long time and since I changed my window installation recently I had to install all of the packages for R. The only package that is not installed is bizdays. The documentations appear to show this package should be still on CRAN, but I cannot find it or install it. Is there any way to somehow install it back?
This is the error I am getting:
install.packages("bizdays")
Installing package into ‘C:/Users/me/OneDrive/Documents/R/win-library/3.6’ (as ‘lib’ is unspecified)
So it seems the package got installed, and when I try to use it this is the error thrown:
library(bizdays)
Error in library(bizdays) : there is no package called ‘bizdays’
You may need to update R to =>4.0
You can check with R.version.
Needing to update R is a fairly common cause of package install problems, as packages can use new R features. You will need to restart RStudio

Installing zeligverse in R 4.0.2

I'm trying to use plot.ci function in the zelig library but apparently Zelig is not supported with R 4.0.2. I'm trying to see if there is a work around to access these functions or if I just can't use this library until they make the appropriate updates. Please help.
Ethan
Error message below:
> install.packages('zeligverse')
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/ethan/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘zeligverse’ is not available (for R version 4.0.2)
It looks like this package has been removed from CRAN's repository, meaning you can't install it like this anymore - you have to install it manually. This is explained on their website, and has download links for manual installation that have been archived:
https://cran.r-project.org/web/packages/zeligverse/index.html
You will also have to install the following dependencies (packages it requires) to install it correctly:
'Amelia', 'MatchIt', 'WhatIf', 'Zelig', 'ZeligChoice', 'ZeligEI'
The Zelig package that is currently available appears to support the function you mentioned. You can install it with:
install.packages("Zelig")

Error while installing R package: package built for universal-apple-darwin

I installed a R package as suggested by How do I install an R package from source?, using R CMD INSTALL [my_pkg_path.tgz]. Package sources are downloaded from r-project.org, e.g., http://cran.r-project.org/web/packages/fields/index.html
However, when I try to load the package using say library(fields), I got the error that complains the package are built for universal-apple-darwin:
Error: package ‘fields’ was built for universal-apple-darwin9.8.0
Guess it's something to do with architecture, but no idea how to resolve it. Any idea? Thanks.
It looks like you downloaded the package's Mac OSX binary file, which usually ends in .tgz - try downloading the package source (usually something ending in .tar.gz) and installing the package again.
Depending on what your operating system is, you may need an additional set of software before you can install packages from source. If the above suggestion doesn't work, would you provide some information about the OS, for example from sessionInfo()?

install a R package needed for your package upon installation

I'm developing a R package that depends on another R package being installed on the users system.
I've added a Depends:pkgname in the DESCRIPTION file and import(pkgname) in the NAMESPACE. What I was hoping this would do is check if pkgname is already installed and if not install.packages(pkgname,repos="CRAN or Rforge or wherever the package is") if not.
However upon attempted installation of my package i get the error:
ERROR: dependency 'pkgname' is not available for package 'mypkg'
Does anyone know how to implement an installation of pkgname, should pkgname not already be on the system?
Many thanks
In the help file of R CMD INSTALL there is no mention of a flag to install additional packages if needed for dependencies. If you submit your package to CRAN, your problems are solved because install.packages then solves any dependencies. install.packages does not support solving dependencies when installing from a local file.
Until you submit to either R-forge or CRAN, I think it will suffice to add a remark to the README file that a few additional packages need to be present. You could even post a snippet of R code containing the needed install.packages command.

R Newbie Confused about Install Packages

I am somewhat new to R, and I thought I understood how to install packages from CRAN mirrors and from source files, but now I am stumped. I currently am using R 2.10.0 on a Windows 7 32-bit machine.
I want to try to use the RGoogleAnalytics package found here and am trying to follow the instructions. They instruct us to install both RCurl and the XML packages from omegahat. For example,
install.packages("RCurl", repos = "http://www.omegahat.org/R")
however this does not work, as I get the following error:
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘RCurl’ is not available
When I try this instead:
install.packages("RCurl", repos = "http://www.omegahat.org/R", type="source")
I get the following error after the file downloads. I previously had version 1.0 and that is restored.
trying URL 'http://www.omegahat.org/R/src/contrib/RCurl_1.5-0.tar.gz'
Content type 'application/x-gzip' length 735041 bytes (717 Kb)
opened URL
downloaded 717 Kb
* installing *source* package 'RCurl' ...
Warning in system("sh ./configure.win") : sh not found
ERROR: configuration failed for package 'RCurl'
* removing 'C:/PROGRA~1/R/R-210~1.0/library/RCurl'
* restoring previous 'C:/PROGRA~1/R/R-210~1.0/library/RCurl'
The downloaded packages are in
‘C:\Users\Brock\AppData\Local\Temp\Rtmpc9wt5N\downloaded_packages’
Warning message:
In install.packages("RCurl", repos = "http://www.omegahat.org/R", :
installation of package 'RCurl' had non-zero exit status
Without going into details, I haven't been able to use the RGoogleAnalytics package as I get the same error that is found in this post. I simply am trying to exhaust every possible option to get around the error.
Any help or insight you can provide will be greatly appreciated!
The RCurl project page on CRAN says the Windows binary is not available. The ReadMe points you to a page maintained by Professor Ripley, where he provides binaries of RCurl and several other packages that have special build needs on Windows. However, he only provides them for the most recent major revision of R, so you would need to upgrade to R-2.12.0 to install them from his page.
If you want to build packages from source on Windows, you need to install Rtools first. It looks like you haven't done that. Even if you had them installed, it will still require extra steps to build RCurl on Windows... else the Windows binary would already be on CRAN.
Your best bet is probably to upgrade R and install RCurl from Prof. Ripley's page.
You are probably missing the components to build packages under Windows:
http://www.murdoch-sutherland.com/Rtools/
According to RCurl FAQ, either
curl-config is not found in your path
or
curl-config and related devlopment libraries (libcurl) are not installed.

Resources