I'm trying to install my own github package for the first time in a little while:
install.packages("devtools")
library(devtools)
install_github("SimonDedman/gbm.auto")
But am getting:
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘foreign’.
ERROR: lazy loading failed for package ‘gbm.auto’
For reference:
.Library : "/usr/lib/R/library"
.libPaths() : "/home/simon/R/x86_64-pc-linux-gnu-library/3.4" "/usr/local/lib/R/site-library" "/usr/lib/R/site-library" "/usr/lib/R/library"
I've read various posts relating to this problem as pertains to installing devtools itself, Rcpp (twice), ggplot2, and devtools dependent packages, but only the 2nd Rcpp one looks vaguely relevant, hence my posting .Library & .libPaths. Even then, I'm on Linux (Xubuntu 17.10 FWIW) and am not doing any fancy RInside magic.
Using the first block of code has always worked in the past; I presume as a user I shouldn't have to manually specify install locations unless I've somehow inadvertently setup R/Rstudio to install devtools packages to a location where they can't interact with default CRAN packages?
So my next guess is that something's changed in how R manages packages/githubs/dependencies etc? Such that as the package developer I need to change something. My NAMESPACE has imports (dismo, mapplots, rgeos) and importFroms (beepr,beep, gbm,plot.gbm, gbm,predict.gbm, maptools,writeSpatialShape, raster,crop, rgdal,readOGR, shapefiles,read.shapefile) only; DESCRIPTION's only Depends is R (>= 3.3.1).
Currently this issue has failed with 'survival', which I then manually installed, and 'foreign' as pasted above. I'm not sure where these are called from, presumably a Depends (or similar) in one of the Import packages. In any case I'm reluctant to manually install everything rather than actually fixing the underlying problem. Any ideas/assistance much appreciated. Cheers!
Edit: session_info()
results, having removed survival
:
Session info --------------------------------
setting value
version R version 3.4.3 (2017-11-30)
system x86_64, linux-gnu
ui RStudio (1.1.419)
language en_GB:en
collate en_GB.UTF-8
tz America/Los_Angeles
date 2018-01-31
Packages --------------------------------------------
package * version date source
base * 3.4.3 2017-12-01 local
compiler 3.4.3 2017-12-01 local
curl 3.1 2017-12-12 CRAN (R 3.4.3)
datasets * 3.4.3 2017-12-01 local
devtools * 1.13.4 2017-11-09 CRAN (R 3.4.2)
digest 0.6.15 2018-01-28 CRAN (R 3.4.2)
git2r 0.18.0 2017-01-01 CRAN (R 3.4.0)
graphics * 3.4.3 2017-12-01 local
grDevices * 3.4.3 2017-12-01 local
httr 1.3.1 2017-08-20 CRAN (R 3.4.3)
memoise 1.1.0 2017-04-21 CRAN (R 3.4.0)
methods * 3.4.3 2017-12-01 local
R6 2.2.2 2017-06-17 CRAN (R 3.4.1)
stats * 3.4.3 2017-12-01 local
tools 3.4.3 2017-12-01 local
utils * 3.4.3 2017-12-01 local
withr 2.1.1 2017-12-19 CRAN (R 3.4.3)