technologiestiftung / flusshygiene-opencpu-base

Base image with all our dependencies for the opencpu kwb-f/fhpredict api
MIT License
0 stars 2 forks source link

Install all CRAN dependencies for "fhpredict" #11

Closed mrustl closed 4 years ago

mrustl commented 4 years ago

With the code below I got all CRAN dependencies for the R package kwb-r/fhpredict@master. Including these should improve the speed of the later installation of fhpredict as most of its >100 dependencies are already there.

install.packages(c("packrat", "remotes"), repo = "https://cloud.r-project.org")
remotes::install_github("kwb-r/pkgmeta")

pkgs_kwb <- pkgmeta::get_github_packages()

remotes::install_github("kwb-r/fhpredict")

deps_fhpredict <- packrat:::recursivePackageDependencies("fhpredict", .libPaths())

deps_fhpredict_cran <- deps_fhpredict[! deps_fhpredict %in% pkgs_kwb$name]

cran_pkgs <- paste("'", deps_fhpredict_cran, "'", sep = "", collapse = ", ")

cran_install <- sprintf("R -e install.packages(pkgs = c(%s), repo ='$MRAN')", cran_pkgs)

writeLines(cran_install, "cran_install.txt")

This change is Reviewable

ff6347 commented 4 years ago

Thanks 🚀 . I'll test this out later on. The build is failing due to missing credentials on your account (I guess). I'll create a new PR with your code (not right now stuck in something else).

mrustl commented 4 years ago

@fabianmoronzirfas maybe you can check if the Docker build works with these changes?