{"id":13736845,"url":"https://github.com/rstudio/packrat","last_synced_at":"2025-05-14T05:10:47.269Z","repository":{"id":11079609,"uuid":"13426098","full_name":"rstudio/packrat","owner":"rstudio","description":"Packrat is a dependency management system for R","archived":false,"fork":false,"pushed_at":"2025-01-31T18:08:07.000Z","size":12802,"stargazers_count":405,"open_issues_count":233,"forks_count":90,"subscribers_count":26,"default_branch":"main","last_synced_at":"2025-04-15T01:53:46.183Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://rstudio.github.io/packrat/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rstudio.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-10-08T21:29:27.000Z","updated_at":"2025-03-22T08:14:43.000Z","dependencies_parsed_at":"2024-05-02T08:54:18.746Z","dependency_job_id":"872b9c8d-8699-4f1e-9900-c890dc74b62a","html_url":"https://github.com/rstudio/packrat","commit_stats":{"total_commits":1576,"total_committers":46,"mean_commits":34.26086956521739,"dds":0.5456852791878173,"last_synced_commit":"a71a5feebb4f4a9fe95c6421f30b5e51424b1863"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio%2Fpackrat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio%2Fpackrat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio%2Fpackrat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio%2Fpackrat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rstudio","download_url":"https://codeload.github.com/rstudio/packrat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254076850,"owners_count":22010611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T03:01:29.683Z","updated_at":"2025-05-14T05:10:47.086Z","avatar_url":"https://github.com/rstudio.png","language":"R","funding_links":[],"categories":["Uncategorized","R Development","R","Miscellaneous"],"sub_categories":["Uncategorized","Dependency Resolution"],"readme":"\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/rstudio/packrat/workflows/R-CMD-check/badge.svg)](https://github.com/rstudio/packrat/actions)\n\u003c!-- badges: end --\u003e\n\n## NOTE\n\nPackrat has been soft-deprecated and is now superseded by\n[renv](https://github.com/rstudio/renv).\n\nWhile we will continue maintaining Packrat, all new development will focus on\n`renv`. If you're interested in switching to `renv`, you can use\n`renv::migrate()` to migrate a project from Packrat to `renv`.\n\n---\n\n# packrat\n\nPackrat is a dependency management system for R.\n\nUse packrat to make your R projects more:\n\n* **Isolated:** Installing a new or updated package for one project won't break\n  your other projects, and vice versa. That's because packrat gives each\n  project its own private package library.\n* **Portable:** Easily transport your projects from one computer to another,\n  even across different platforms. Packrat makes it easy to install the\n  packages your project depends on.\n* **Reproducible:** Packrat records the exact package versions you depend on,\n  and ensures those exact versions are the ones that get installed wherever you\n  go.\n\nSee the [project page](https://rstudio.github.io/packrat/) for more information,\nor join the discussion on the\n[RStudio Community forums](https://community.rstudio.com).\n\nRead the [release\nnotes](https://github.com/rstudio/packrat/blob/master/NEWS.md) to learn what's\nnew in Packrat.\n\n# Quick-start Guide\n\nStart by installing Packrat:\n\n    install.packages(\"packrat\")\n\nThen, start a new R session at the base directory of your project and type:\n\n    packrat::init()\n\nThis will install Packrat, set up a private library to be used for this\nproject, and then place you in `packrat mode`. While in packrat mode, calls to\nfunctions like `install.packages` and `remove.packages` will modify the\nprivate project library, rather than the user library.\n\nWhen you want to manage the state of your private library, you can use the\nPackrat functions:\n\n- `packrat::snapshot()`: Save the current state of your library.\n- `packrat::restore()`: Restore the library state saved in the most recent\n  snapshot.\n- `packrat::clean()`: Remove unused packages from your library.\n\nShare a Packrat project with `bundle` and `unbundle`:\n- `packrat::bundle()`: Bundle a packrat project, for easy sharing.\n- `packrat::unbundle()`: Unbundle a packrat project, generating a project\n  directory with libraries restored from the most recent snapshot.\n\nNavigate projects and set/get options with:\n- `packrat::on()`, `packrat::off()`: Toggle packrat mode on and off, for\n  navigating between projects within a single R session.\n- `packrat::get_opts`, `packrat::set_opts`: Get/set project-specific settings.\n\nManage ad-hoc local repositories (note that these are a separate entity from\nCRAN-like repositories):\n- `packrat::set_opts(local.repos = ...)` can be used to specify *local\n  repositories*; that is, directories containing (unzipped) package sources.\n- `packrat::install_local()` installs packages available in a local\n  repository.\n\nFor example, suppose I have the (unzipped) package sources for\n[`digest`](https://cran.r-project.org/package=digest) located\nwithin the folder`~/git/R/digest/`. To install this package, you can use:\n\n    packrat::set_opts(local.repos = \"~/git/R\")\n    packrat::install_local(\"digest\")\n\nThere are also utility functions for using and managing packages in the\nexternal / user library, and can be useful for leveraging packages in the user\nlibrary that you might not want as project-specific dependencies, e.g.\n`devtools`, `knitr`, `roxygen2`:\n\n- `packrat::extlib()`: Load an external package.\n- `packrat::with_extlib()`: With an external package, evaluate an expression.\n  The external package is loaded only for the duration of the evaluated\n  expression, but note that there may be other side effects associated with\n  the package's `.onLoad`, `.onAttach` and `.onUnload` calls that we may not\n  be able to fully control.\n\n# Workflows\n\nPackrat supports a set of common analytic workflows:\n\n1. `As-you-go`: use `packrat::init()` to initialize packrat with your project,\n   and use it to manage your project library while you develop your analysis.\n   As you install and remove packages, you can use `packrat::snapshot()` and\n   `packrat::restore()` to maintain the R packages in your project. For\n   collaboration, you can either use your favourite version control system, or\n   use `packrat::bundle()` to generate a bundled version of your project that\n   collaborators can use with `packrat::unbundle()`.\n\n2. `When-you're-done`: take an existing or complete analysis (preferably\n   collected within one directory), and call `packrat::init()` to immediately\n   obtain R package sources for all packages used in your project, and snapshot\n   that state so it can hence be preserved across time.\n\n# Setting up your own custom, CRAN-like repositories\n\nPlease view the [set-up\nguide](https://rstudio.github.io/packrat/custom-repos.html) here for a simple\nwalkthrough in how you might set up your own, local, custom CRAN repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frstudio%2Fpackrat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frstudio%2Fpackrat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frstudio%2Fpackrat/lists"}