error when installing package using 'devtools' in R - r

I try to install the package RSelenium:
devtools::install_github("ropensci/RSelenium")
This gives me following error:
Downloading GitHub repo ropensci/RSelenium#master
from URL https://api.github.com/repos/ropensci/RSelenium/zipball/master
Installing RSelenium
Error: Found continuation line starting ' <!DOCTYPE html PUB ...' at begin of record.
Some research thaught me that I can simple install it using
install.packages("RSelenium, type="Source").
This indeed successfully installs the package, but gives trouble when using the function getPageSource() as mentioned here.
EDIT: I'd also like to add that before the package installed successfully, but at one point it suddenly kept on failing.

Related

Unable to install package Sleuth in 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).

How to install R packages when github is blocked using papaja as an example

I thought I would post this as an answer to anyone having problems installing papaja (or other packages) when behind a firewall that doesn't allow github
The problem
For reasons I dont fully understand, the only way I am able to use github R packages is to download them into my github desktop and then use them using the remotes::install_local("C:\\[path]\\GitHub\\papaja") function. This has worked for all the R packages available from github (CRAN installations are fine).
However this is not the case with papaja which gives me the error:
'Error in curl::curl_fetch_memory(url, handle = h) :
Failed to connect to api.github.com port 443: Connection refused'
I suspect this is because a call is being made to github during the package installation (otherwise why dont I get this issue with all of the other packages I've installed this way).
The attempts
So I went ahead and tried
remotes::install_local("C:\\[path]\\GitHub\\papaja",dependencies=FALSE)
It gave me the error:
ERROR: dependencies 'bookdown', 'rmdfiltr' are not available for package 'papaja'
The answer
So I installed these separately from CRAN and then re ran
remotes::install_local("C:\\[path]\\GitHub\\papaja",dependencies=FALSE)
and the papaja successfully installed. So I guess the installation for the dependencies bookdown and rmdfiltr are making a call to github when they could be installed from CRAN?
So I guess if you get the same error, switch off dependecy installation and install them separately

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...?

r package installed properly but "there is no package called ‘DiabetesTxPath-master" error

I'm trying to install a package called "DiabetesTxPath-master" from local files.(The file can be downloaded in https://github.com/rohit43/DiabetesTxPath)
I used the code below installing it.
'filename<-"DiabetesTxPath-master.zip"'
install.packages(filename,type="binary",repos=NULL)
but when I try to load the packaged by the code below,
library(DiabetesTxPath)
error comes up.
there is no package called ‘DiabetesTxPath-master'
There is no problem in location.
.libPaths()
[1] "C:/Program Files/R/R-3.4.2/library"'
and this is where I want my package to be installed.
(and I see my packaged installed in the folder with my eyes!)
2.I've also tried to run as an administrator. it didn't work either.
So what could be the probelm, and how could I fix this?
Any comment would be appreciated so much.
I've been trying it so hard for a week.
Try using
library(devtools)
install_github("rohit43/DiabetesTxPath")
the problem arises because the dependencies for this package
ERROR: dependencies 'FeatureExtraction', 'CohortMethod',
'OhdsiSharing' are not available for package 'DiabetesTxPath'
are not available for this package in R 3.5 and above .
Now you need to install older version of R where these dependencies were supported and try using the above method.

Why do I get a syntax error in devtools::install_github?

I am new in working with linux. I am trying to analyse sequencing data using dropEst pipeline https://github.com/hms-dbmi/dropEst#dropreport. I want to run the DropReport and for that I need to install dropEstR package.
I tried by :
devtools::install_github('hms-dbmi/dropEst/dropestr' , dependencies = T)
as they suggest and I get as an error:
bash: syntax error near unexpected token
`'hms-dbmi/dropEst/dropestr','
Do you have any idea what should I do differently?
I think you are using the "wrong" shell. You have to use R/RStudio, when you want to use the devtools package. From CRAN:
Title Tools to Make Developing R Packages Easier
I just tried you command in RStudio but installation fails in the end:
ERROR: dependency 'Rcpp' is not available for package 'dropestr'
* removing 'C:/R/R-3.4.2/library/dropestr'
Installation failed: Command failed (1)
You have to run such script on RStudio for R. Import your project here and run it.
You can download it from enter link description here
Happy Coding.

Resources