Closed danm0nster closed 2 years ago
One solution would be for groundhog to automatically choose a repository by default if one has not been set. That's easy to implement, would need to read whether the CRAN folks consider that acceptable behavior for a package. In the meantime, if you add this line to the first line of your scripts, i think it will solve the issue for you:
options(repos="https://cloud.r-project.org")
it does seem outdated for R to actively ask users to select a server.
(edit: actually, maybe your suggestion is better, add an option to groundhog.library, probably more robust (if URLs change over time) and better etiquette)
Yeah, i will do that. Include the same repos
option available in install.packages()
One solution would be for groundhog to automatically choose a repository by default if one has not been set. That's easy to implement, would need to read whether the CRAN folks consider that acceptable behavior for a package. In the meantime, if you add this line to the first line of your scripts, i think it will solve the issue for you:
options(repos="https://cloud.r-project.org")
Thanks, this is a nice workaround, that I will be using until, perhaps, there is another way.
Thanks also for developing groundhog!
A script using groundhog apparently has to be run at least once in interactive mode (e.g., in R or RStudio) before working in batch mode. This is because a CRAN mirror needs to be chosen which requires input from the user. There might be a workaround via an environment variable or some other solution, but it would be nice to have an option allowing groundhog to run in batch and download and install the necessary libraries.
Here is a minimal example of a script that will run using
Rscript
when the right permission bits are set (chmod u+x <filename>
) on a Unix system.When attempting to run this script, I get the following error:
If I run it once in an interactive R session and select a CRAN mirror, it will susequently work from the command line.
I have to do this for every script in my chain before I can invoke them automatically, e.g. using make and Makefiles (for greater reproducibility).
I hope there is an easy solution, perhaps via a new option in
groundhog.library()
.