Skip to content

Instantly share code, notes, and snippets.

@cderv
Last active November 8, 2017 09:26
Show Gist options
  • Save cderv/a39c7255de1b90b60b32a4cdb22eb90c to your computer and use it in GitHub Desktop.
Save cderv/a39c7255de1b90b60b32a4cdb22eb90c to your computer and use it in GitHub Desktop.
How Packrat work

Fonction getPackageRecords

Parse description and call inferPackageRecord. Produce a table parsing the Description file

  1. Package desc field
  2. Version desc field
  3. Repo from getOption("repo")
  4. (optionnaly) GithubRepo desc field (Where does it come from ? devtools::install_github ?). if found, then return the table with dcf field name = Package|source = "github"|version = Version|gh_repo = Githubrepo|gh_username=GithubUsername|gh_ref=GithubRef|gh_sha1=GithubSHA1|gh_subdir=GithubSubdir
  5. if priority base return NULL
  6. if biocViews in desc field, then bioconductor pkg return name = Package|source = "Bioconductor"|version = Version
  7. if Repository desc field is CRAN (when ?) then return name = Package|source = "CRAN"|version = Version
  8. if InstallSource desc field is Source the return name = Package|source = "source"|version = Version
  9. if local developpement name = Package|source = "unknown"|version = Version

Cran like REPO

Packrat deals with CRAN like Repo : field source is CRAN, Bioconductor or pkgrecord inherit CustomCRANLikeRepository class or field source in DESCRIPTION pkgRecord$source. see packrat::installPkg. pkgRecord = packrat:::lockInfo(project)

About Restore

  • Change libpaths
  • Reinstall from source
    • Can be overlay by env variable R_PACKRAT_SRC_OVERLAY in overlaySourcePackages. Find the use case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment