New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
options("repos") only changed to MRAN when scanForPackages = TRUE and there is a new package to install #274
Comments
|
I agree with the comment above, I've been scratching my head with similar behaviour. After I've installed my packages I've realised that when I started the project again, checkpoint date doesn't get updated automatically. I though something is wrong but it's probably the expected behaviour as suggested in the comment above. Outputs: Outputs: (note: I am using Open R) However, I would have expected: "https://mran.microsoft.com/snapshot/2019-03-10" as this is THE checkpoint date I've specified. Is there a rationale behind this behaviour? It would be helpful to describe it in help file. |
|
Yes, I agree this is a confusing and it would help a lot if it would be clarified in the The second point you have to think about are the library paths where R looks for packages. |
This seems like a good solution to ensure your collaborators use appropriate libraries. I'd probably even put the |
|
Any news on this? One currently needs a hole set of workarounds to make it work as advertised. This is what I have currently: snapshot <- "2019-11-01"
# set it by default; otherwise pinging takes ages
options(checkpoint.mranUrl = "https://mran.microsoft.com/")
# Scanning takes ages (due to slow url checks), but we need to scan if the
# repo doesn't exist
# https://github.com/RevolutionAnalytics/checkpoint/issues/281
do_scan <- !snapshot %in% checkpoint::checkpointArchives()
checkpoint::checkpoint(snapshot, scanForPackages = do_scan, verbose = interactive())
## https://github.com/RevolutionAnalytics/checkpoint/issues/274
checkpoint::setSnapshot(snapshot, FALSE)
|
|
This should be resolved in the new v1.0 checkpoint, just pushed to master. If you want to use an existing checkpoint without installing any packages: use_checkpoint("snapshot_date") |
First of all thanks for the checkpoint package, I am using this a lot to ensure reproducibility of my analyses!
Recently I found some (for me) surprising behaviour of checkpoint, which seems to be a bug to me.
What I thought calling
checkpoint::checkpointwould do:.libPathsso new packages are loaded and installed to the checkpoint folderoptions("repos")to the MRAN snapshot, so callinginstall.packages()will install from the MRAN website instead of CRAN.But the second point only seems to be TRUE if I run checkpoint with
scanForPackages = TRUEand there is a new package found, which is not already installed. Elseoption("repos")is not changed, soinstall.packageswill install the latest package from CRAN into the checkpoint folder.I think this is very confusing and probably has negative effects on reproducibility.
I see this code inside the checkpoint function:
So repos is only changed when there are new packages to install. Wouldn't it be better to change this independently even if there are no new packages to install? Because users will still install new packages with
install.packagesand if these packages are installed fromcran.rstudio.comthe whole point of reproducibility with checkpoint is contradicted.Here is example code to reproduce the problem:
The text was updated successfully, but these errors were encountered: