Skip to content
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

File source for mran url not supported #217

Closed
mungojam opened this issue Jun 7, 2016 · 1 comment
Closed

File source for mran url not supported #217

mungojam opened this issue Jun 7, 2016 · 1 comment

Comments

@mungojam
Copy link
Contributor

mungojam commented Jun 7, 2016

I tried to repoint checkpoint to a file url ('file:///'), but it failed in two places: is.404 function and getValidSnapshots because both make use of readLines which doesn't work for file urls (when they are pointing to folders anyway). This code gives the error: cannot open file 'C:/Local/R/MRAN/': Permission denied:

options(warn = 2) #treat warnings as errors since we don't expect any

#Sets up the checkpoint package which ensures that we
#get packages from a tested snapshot date i.e. different
#users of the script all use exactly the same package versions
SetupCheckpoint <- function() {
  message("Setting up checkpoint")

  options(checkpoint.mranUrl = "file:///C:/Local/R/MRAN/")

    #Get packages as of the following, tested snapshot date
  librarySnapshot <- "2016-03-09"
  R.version <- "3.2.3"

  checkpointLocation <- file.path(Sys.getenv("USERPROFILE"), "R")

  if(!dir.exists(file.path(checkpointLocation, ".checkpoint"))) {
    dir.create(file.path(checkpointLocation, ".checkpoint"), recursive = TRUE)
  }

  checkpoint(librarySnapshot, 
             R.version = R.version, 
             checkpointLocation = checkpointLocation)

}

SetupCheckpoint()
@mungojam
Copy link
Contributor Author

mungojam commented Jun 7, 2016

#218 Pull request created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants