Error Installing package from github with devtools - r

Trying to install the lego package from Github on Windows in R version 3.1.1 gives the following error:
Error in set(new) : cannot change working directory.
I can verify that Rtools in installed fine and find_rtools() returns TRUE. The debug information indicates it find it in the right location.

This error is caused by wrong command.
The standard command for change working director is setwd(new)

Related

Install R packages problem using RStudio Package Manager

I tried to install R packages using RStudio Package Manager using the following code:
install.packages("dplyr", type = "source")
and
install.packages("dplyr")
and it gives the following error:
Error in install.packages : invalid version specification 'r56550'
What should I do? I tried to google the error but nothing comes up. I have tried to delete and reinstall R and RStudio but i still received the error. I tried to download both the existing binary and the source file and neither ways worked. I tried to install different packages and repeated in both R and Rstudio and nothing worked.
Thank you!
Update 1: I'm using R version 4.0.5 and RStudio version 1.4.1106. I have also downloaded Rtools40 according to the instruction in the following website: https://cran.r-project.org/bin/windows/Rtools/. I'm using Windows. By 'R Manager' I meant the package manager console in RStudio.
Update 2: I'm not sure if there is no network issue or proxy. If I download the packages directly through the CRAN mirror, then it works. But we are trying to download packages in an offline environment, that's why I need RStudio Package Manager.

Can not install processr and procesR on Windows

Following this question, I am trying to install the package (running R64 as admin on Windows):
devtools::install_github("markhwhiteii/processr")
or
devtools::install_github("cardiomoon/processR")
However, I get the error message:
Error: Failed to install 'processr' from GitHub:
(converted from warning) cannot remove prior installation of package 'digest'
no matter which update option I select. Running the command .libPaths() I found the packages installation folder C:/Program Files/R/R-3.6.2/library and manually deleted the digest package and reinstalled it with package.install("digest"). But I still get the same error! I would appreciate it if you could help me understand what is the problem and how I can resolve it.
The simplest solution is to say no when install_github asks if it should replace digest.
If it still fails for some reason (and I can't see why; neither package requires a specific version of digest and you've reinstalled it in any case), then the problem is that devtools itself uses digest, so it can't be removed as long as devtools is loaded. So you can't use install_github.
You have a couple of options:
Clone the repo, then from the command line, run R CMD INSTALL . in that directory. Note that you'll need to insert the path to your R executable.
Install from the GitHub archive of the master branch: install.packages("https://github.com/markhwhiteii/processr/archive/master.tar.gz")
The steps to install the markhwhiteii/processr package:
install.packages("devtools")
library(devtools)
install.packages("https://github.com/markhwhiteii/processr/archive/master.tar.gz")
for testing the instalation:
library(processr)
processr::model1
Sent a PR on the GitHub repo.
and if you want to run R in the Jupyter environment just follow the instructions to install and regsiter the kernel:
install.packages('IRkernel')
IRkernel::installspec()

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]

Trouble installing and loading "mlrMBO" package in R

So when I install the package, R returns the following error message:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘mlrMBO’
But It then says the package has non-zero exit status and is in
‘/private/var/folders/b_/xwf1w6cn769_2gq06fntysxm0000gn/T/RtmpCGAr62/downloaded_packages’
When I load the package
library(mlrMBO)
It says the package doesn't exist.
I've tried many different methods like using this code
install.packages('mlr', repo='http://cran.fiocruz.br/')
Here's a couple of things you could try:
Make sure you don't have any Umlauts (ö,ä,ü, å) in your path, i.e. your User-folder, if you're running on windows.
Install devtools install.package("devtools)
clear data in \AppData\Local\Temp\
That package requires compiling C code, for which you have to install the Xcode developer tools.
Per Housemd's answer at Apple.SE:
Open Terminal, and run the following:
xcode-select --install
This will download and install xcode developer tools and fix the problem. The problem is that one needs to explicitly agree to the license agreement.
I found the solution in this question, Command Line Tools not working.
Once you've done that, run install.packages again.

'curl_version_info_data' has no member named 'libssh_version'

I need to install plotly package for R(3.3.1) in a Redhat server 5.11. It requires curl to be installed first. I downloaded the package from https://cran.r-project.org/web/packages/curl/index.html.
When I try to install the package, it gives below error:
version.c: In function 'R_curl_version':
version.c:15: error: 'curl_version_info_data' has no member named 'libssh_version'
version.c:15: error: 'curl_version_info_data' has no member named 'libssh_version'
make: *** [version.o] Error 1
ERROR: compilation failed for package 'curl'
Has anyone had the same issue before?
Thanks in advance for any suggestion.
You need to install the development version of the curl library before installing the package. Try yum install curl-devel.
One note though - whenever you run into a similar error it is typically because a development version of a library is not installed on your redhat system.
Thanks Jim for your reply.
I found the solution is to use a lower version curl package which has not included the definition for "libssh_version" in the file version.c, e.g. curl_0.9.6.tar.gz with the command:
sudo R CMD INSTALL curl_0.9.6.tar.gz
I've also tried "yum install curl-devel", but it shows the message:
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Install Process
Package curl-devel-7.15.5-17.el5_9.x86_64 already installed and latest version
Package curl-devel-7.15.5-17.el5_9.i386 already installed and latest version
Nothing to do

Resources