Gmichael
Gmichael

Reputation: 568

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?

Upvotes: 15

Views: 47487

Answers (2)

Arnold Cross
Arnold Cross

Reputation: 329

After reading this question/solution plus others, and experimenting with a package update, I wrote the following paragraph in my own instruction (to myself) for updating R packages. I'm posting it here, because I think it may be helpful to others. I'm pretty sure it is correct, except that some updates may fail for reasons that have nothing to do with their compilation status.

On the pop-up, "Do you want to install from source the packages which need compilation?", [No] will ensure that all packages get updated, but not necessarily to their latest versions. [Yes] should update everything to its latest version, but only if you installed the latest Rtools. If Rtools is not up to date, then among packages that have not yet been compiled to binaries, [Yes] will successfully update some (or none) and will fail on some (or none). If any fail, then update.packages() can be run again, selecting [No] to get the latest versions available without updating Rtools.

Upvotes: 5

Aadish Chopra
Aadish Chopra

Reputation: 26

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?

Upvotes: 1

Related Questions