Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R keeps asking about "installing from sources that need compilation"

I am trying to install packages (devtools, plyr and several others) and keep getting stuck with the same problem, which seems to appear for some packages more often than others

 There are binary versions available but the
  source versions are later:
          binary source needs_compilation
processx  2.0.0.1  3.2.1              TRUE
desc        1.1.1  1.2.0             FALSE
callr       1.0.0  3.1.1             FALSE
git2r      0.21.0 0.24.0              TRUE
rcmdcheck   1.2.1  1.3.2             FALSE
usethis     1.1.0  1.4.0             FALSE
devtools   1.13.4  2.0.1             FALSE

Do you want to install from sources the packages which need compilation?

OK, well, I honestly have no idea what that means, but chances are 50/50

Whether I choose y or n I end up with:

Packages which are only available in source
  form, and may need compilation of
  C/C++/Fortran: ‘ps’ ‘fs’ ‘pkgload’
Do you want to attempt to install these from sources?
y/n: 

and whether I choose y or n here I end up with

Warning in install.packages :
  installation of package ‘devtools’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/zz/mxrvmdvd2j399kfylbspjp4r0000gn/T/Rtmp1OdcyF/downloaded_packages’

I am operating on Mac Mojave 10.4.2 with RStudio 1.1.463

My expected result was for the package to be installed and I could use something like library(package) to get started with my work.

I am somewhat experienced in working with R and have never encountered this problem until recently? Do I need to update sth? Change a setting?

UPDATE: ggplot2 and biomod2 are showing the same issue UPDATE: seems to be no problem with R (not RStudio) and the R package manager.... why is this the case?

like image 207
Gmichael Avatar asked Jan 24 '19 12:01

Gmichael


People also ask

Do you have to install packages every time you use R?

You only need to install packages the first time you use R (or after updating to a new version). **R Tip:** You can just type this into the command line of R to install each package. Once a package is installed, you don't have to install it again while using the version of R!

Why I Cannot install package in R?

Changing the configuration in R Studio to solve install packages issue. Go To Tools -> Global option -> Packages. Then uncheck the option “Use secure download method for HTTP”. For other RStudio issues refer to official Troubleshooting Guide here.

How do I stop a package from installing in R?

install. packages("Deriv") if (! "Deriv" %in% installed. packages()[, "Package"]) { stop("Package Deriv not installed successfully.") }

Do you want to restart R prior to installing?

Restarting R prior to updating these packages is strongly recommended. RStudio can restart R and then automatically continue the installation after restarting (all work and data will be preserved during the restart).


1 Answers

For packages where it says needs compilation : TRUE you would need RTools if you hit "n" on the dialog box.

RTools usually are installed in the C: Drive on Windows.

This question is similar to yours.

How do I install an R package from source?

like image 79
Aadish Chopra Avatar answered Sep 28 '22 09:09

Aadish Chopra