Unable to install package Sleuth in R - r

I've been trying to install the Sleuth package in R all morning and it keeps giving me errors. This is how I tried to install it:
if(!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("DESeq2")
BiocManager::install ("rhdf5")
install.packages("devtools")
devtools:: install_github("pachterlab/sleuth")
I did use the library() command.
I get the following error messages:
Error: object 'h5write.default' is not exported by 'namespace:rhdf5'
Execution halted
ERROR: lazy loading failed for package 'sleuth'
removing 'C:/Users/31625/OneDrive/Documents/R/win-library/4.1/sleuth'

I was having the same issue and found that there's current an open issue on Github discussing this problem.
Currently there is a workaround which was shared in the same issue on Github:
Run git clone https://github.com/pachterlab/sleuth
Remove the last line in ./sleuth/NAMESPACE which is the h5write.default that raises the error during installation - ignore the warning in the first line
Then in R: devtools::install('./sleuth/')
It worked for me while using Linux - ZorinOS and R 4.1.2 but it should work on Windows as well.
Someone also opened a PR to fix the whole issue but it seems they are not updating the package anymore (unfortunately).

Related

Error: Install papaja package and updating R

Problem: I was trying to install the papaja package
devtools::install_github("crsh/papaja")
I received this error:
Error: Failed to install 'reprex' from GitHub:
System command 'Rcmd.exe' failed, exit status: -1, stdout + stderr empty
To potentially resolve this error, I tried to update R and this came up:
Warning message:
In shell(install_cmd, wait = wait, ...) :
'C:\Users\naomi\AppData\Local\Temp\RtmpyQPZSR/R-4.0.3-win.exe' execution failed with error code 127
The first error is my main issue which I am trying to resolve. I would appreciate your help with diagnosing both.
This is my current R version: R version 4.0.2 (2020-06-22)
There are several potential issues and it isn't completely clear to me what the issue is just judging from the error code. Here's what I'd try to do:
Check your installation of Rtools and if it is the right version for R 4.0.2
Check if devtools is updated/reinstalled after upgrading to R 4.0.2 (potentially from 3.x.x)
Try installing R 4.0.3 using admin rights, then it should work.
If you still can't install using devtools, try to download the package as .tar.gz and install from the local file.
I hope this helps. I will check if my suggestions helped you out.

Unable to install 'Velocyto.R' from Github

I am a beginner in R
trying to analyze my scRNA-seq data with velocyto.R in R studio.
Following velocyto tutorial, I tried installing velocyto.R as below:
library(devtools)
install_github("velocyto-team/velocyto.R")
But, an error pops up:
ERROR: compilation failed for package 'velocyto.R'
removing 'C:/Users/USER/Documents/R/win-library/3.6/velocyto.R'
Error: Failed to install 'velocyto.R' from GitHub:
(converted from warning) installation of package ‘C:/Users/USER/AppData/Local/Temp/RtmpukpRFl/file37346a812b86/velocyto.R_0.6.tar.gz’ had non-zero exit status
Is there anyone to face the same problem described above and succeed in resolving it after all?
I desperately need helps!
Thanks
As your error log says C:/..., you probably use Windows. According to velocyto's README it seems that this package runs only on unix-flavored systems with C++11, Open MP, boost, igraph and hdf5c++ libraries.
This can be the problem: read the velocyto's GitHub issue #40, maybe you'll need to run this under WSL...?

Cannot install rstanarm (R crashes)

A similar question was asked here, but I tried the code Tiago Lubiana posts there, to no avail.
I haven't been able to install rstanarm after several attempts. R keeps crashing during the installation.
I did install rstan by running
install.packages("rstan", repos = "https://cloud.r-project.org/", dependencies = TRUE)
When I want to install rstanarm, nothing seems to work, though. I've tried the following:
1) install.packages("rstanarm"): R crashes and installs a folder called 00LOCK-rstanarm, plus the corresponding rstanarm folder. When I open R, rstanarm is there, but after running library(rstanarm), I get
Error: package or namespace load failed for ‘rstanarm’ in library.dynam(lib, package, package.lib):
shared object ‘rstanarm.so’ not found
By running install.packages("rstanarm") again, I get:
ERROR: failed to lock directory ‘/home/nalerive/R/x86_64-pc-linux-gnu-library/3.5’ for modifying
Try removing ‘/home/nalerive/R/x86_64-pc-linux-gnu-library/3.5/00LOCK-rstanarm’
Warning in install.packages :
installation of package ‘rstanarm’ had non-zero exit status
Deleting that folder has not solved the problem (but see here for a similar error with another package).
2) From here, running
if (!require(devtools)) { install.packages("devtools")
library(devtools) }
install_github("stan-dev/rstanarm", build_vignettes = FALSE)
leads to R crashing again, and the same folders as in 1) are installed. I also get the same error by running library("rstanarm"), namely:
Error: package or namespace load failed for ‘rstanarm’ in library.dynam(lib, package, package.lib):
shared object ‘rstanarm.so’ not found
3) Following this post I tried
install.packages("rstanarm", dependencies = TRUE, repos="http://cran.rstudio.com/", INSTALL_opts = c('--no-lock'))
and R keeps crashing.
I've tried more things, like removing the 00LOCK-rstanarm folder by means of unlink("/home/nalerive/R/x86_64-pc-linux-gnu-library/3.5/00LOCK-rstanarm/", recursive = TRUE); restarting R when indicated; checking my C++ toolchain (as suggested here), etc... but nothing has worked. I really feel hopeless at this point.
I have R version 3.5.2, rstan version 2.19.2, and Linux 4.15.0-1-amd64 #1 SMP Debian 4.15.4-1~mx17+1 (2018-02-23)
Any help will be highly appreciated. Thanks in advance!

errors when installing older dplyr package in R

Im a bit new to R and need to use/adapt someone else code in R.
My supervisor uses R version 3.2.2 with the dplyr package version 0.4.3 (to overcome errors and problems with the original code).
I tried to install the older dplyr package with different methods:
- installed devtools package and then used the url devtools::install_url("http://cran.r-project.org/src/contrib/Archive/dplyr/dplyr_0.1.2.tar.gz")
- manual installation (where I downloaded the file and tried to install it.) Installation seemed to have worked but when I run the code it gives a fatal error massage
Every way I've tried so far either gives a lot of error messages or a fatal error and shutdown.
When using help ?dplyr it gives a pop-up that there is an error. Does anybody have any other ideas to install this package?
Thanks!

Error in running swirl package in R

I am not able to work in swirl package in R. I am able to install the swirl
package correctly. But while giving the library("swirl") command the error comes up.I have tried every thing like I am not able to find the answer of this error on internet. I have reinstalled R complete. I have tried changing directory. But still this error message is coming. Please help.This is the error message:
library("swirl")
Error in get(Info[i, 1], envir = env) :
cannot open file
'C:/Users/Devender/Documents/R/win-library/3.2/httr/R/httr.rdb': No such
file or directory
Error: package or namespace load failed for ‘swirl’
Thanks alot in advance
Try installing httr package. I think it will solve your problem.
You did not say which R version you are using.
Some Swirl packages are not available for few R versions as 3.2.2. You cant even download any courses from Github repositories into the Swirl if Swirl was successfully loaded in R.
You may want to re-install a different version of R to avoid this Swirl issue, and try again.

Resources