Error: Install papaja package and updating R - 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.

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

Unable to install 'cli' package from GitHub repository using remotes::install_github()

I had recently posted a question about a unicode display issue linked here. The problem then was the 'cli' package bug in the version cli v2.0.0. This bug had been brought up and has been solved on the master branch on GitHub by the developer. I am trying to install the same using remotes::install_github("r-lib/cli"). RStudio connects to GitHub fine, downloads the package, begins installing it, goes onto the step for building the package and then returns an error. The error message is copied below:
Error: (converted from warning) Setting LC_CTYPE failed, using "C"
Execution halted
Error: Failed to install 'cli' from GitHub:
(converted from warning) installation of package '/var/folders/n0/__v02y5j02sby1w2_39185sh0000gn/T//Rtmp5HnvTL/file865408954cc/cli_2.0.0.9000.tar.gz' had non-zero exit status
Session information:
R version 3.6.1
macOS Catalina
Steps taken to solve the problem:
1.Have tried using the 'devtools' package to do the same; Same error message
2.Have reinstalled the Xcode developer tools on the system
3.Tried removing and reinstalling 'cli'. I can install from CRAN with the same bug in it; still cannot install from GitHub repo.
Any thoughts would be appreciated.
The same commands worked when I ran them in R console through terminal as superuser (sudo R from terminal). The packages compiled properly and installed.
Two pages which helped are linked below:
[Installing a package inside RStudio fails on macOS Catalina
[https://support.rstudio.com/hc/en-us/articles/200554786-Problem-Installing-Packages]

"Non-zero exit status" error message when installing ggplot2 in RStudio

I have previously used ggplot2, in fact I was using the package as this problem arose.
I updated all of my packages, and found that I could no longer access basic packages (ggplot2, tidyvers, dplyr ect). When I try to install packages via install.packages("ggplot2"), I receive the error message attached below.
I then proceed to use the library with library(ggplot2), and the error message, "there is no package called ‘ggplot2’" is deployed. I am using R version 3.5.1 and R studio 1.1.423. I am using Mac version 10.12.6 (macOS Sierra), using an outdated version for other reasons. I am writing my current code in RStudio. Can anyone decipher what is going on with my code?
Error message seen when command line tools were updated
Error Message 2

R - can't install package "rgl"

I've followed as many threads as I can on this to resolve, but no luck. Simply can't install R package "rgl". I have Upgraded Ubuntu server 16 to R version 3.3.1.
PuTTY X11 proxy: Unsupported authorisation protocol
Warning in rgl.init(initValue, onlyNULL) :
RGL: unable to open X11 display
Warning: 'rgl_init' failed, running with rgl.useNULL = TRUE
* DONE (rgl)
I've tried these bits of advice:
Error in installing rgl package
error: installation of package ‘rgl’ had non-zero exit status
I have X11 working fine outside R:
http://www.tomsitpro.com/articles/how-to-use-x11-forwarding,2-843.html
but still get the error above.
Thanks for any help,
S.
Ok, this seems to be solved. I was root, after exiting and using:
sudo R
install.packages("rgl")
everything was ok. so it seems you must install as sudo, not root, for everything to go in the right place.
Thanks,
S.
I checked it. Everything seems to work properly... Rscript - screen
But in "related" here I see some questions about error in installing rgl. Take a look e.g. Error in installing rgl package

Error installing packages in Rstudio

I have R 3.2.2 setup installed in my system,with RStudio version 0.99.489. When I tried to install rJava package,
install.packages("rJava")
I am getting following Error:
Warning in install.packages :
downloaded length 4878 != reported length 200
Error in install.packages : subscript out of bounds
But if I run the below command before installing any package,it works fine, but I don't want to do this every time I install a package.
options(repos=structure(c(CRAN="http://cran.us.r-project.org")))
You can stick the line you want executed at every startup in your .Rprofile file which should be in your home directory. I have 3.2.3 version of R and that worked; however I do get a warning message about using a non-http version of the site.
Similarly to you, I was finding the original repository the system was using was failing to install the packages--not finding the package or downloading a file with too few bytes, perhaps because of a transient problem. You might want to consider not putting this in your .Rprofile file or commenting the line outin case this is a temporary workaround.

Resources