<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://info.stat.cmu.edu/index.php?action=history&amp;feed=atom&amp;title=Renv</id>
	<title>Renv - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://info.stat.cmu.edu/index.php?action=history&amp;feed=atom&amp;title=Renv"/>
	<link rel="alternate" type="text/html" href="https://info.stat.cmu.edu/index.php?title=Renv&amp;action=history"/>
	<updated>2026-11-04T22:49:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://info.stat.cmu.edu/index.php?title=Renv&amp;diff=839&amp;oldid=prev</id>
		<title>Ajshen at 03:29, 29 June 2026</title>
		<link rel="alternate" type="text/html" href="https://info.stat.cmu.edu/index.php?title=Renv&amp;diff=839&amp;oldid=prev"/>
		<updated>2026-06-29T03:29:16Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 03:29, 29 June 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Containers and Virtual Environments]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Like &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;python&amp;lt;/code&amp;gt;, R has a package management tool (albeit less advanced), called [https://rstudio.github.io/renv/ &amp;lt;code&amp;gt;renv&amp;lt;/code&amp;gt;]. I personally recommend having these for any package / set of tools you develop. I’m going to introduce it relative to a shiny app on our shiny server&amp;lt;ref&amp;gt;In the future I can imagine someone extending to this commentary with commentary relative to a &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt; package or at least a github repository - not just a set of files.&amp;lt;/ref&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Like &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;python&amp;lt;/code&amp;gt;, R has a package management tool (albeit less advanced), called [https://rstudio.github.io/renv/ &amp;lt;code&amp;gt;renv&amp;lt;/code&amp;gt;]. I personally recommend having these for any package / set of tools you develop. I’m going to introduce it relative to a shiny app on our shiny server&amp;lt;ref&amp;gt;In the future I can imagine someone extending to this commentary with commentary relative to a &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt; package or at least a github repository - not just a set of files.&amp;lt;/ref&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key infowiki:diff:1.41:old-13:rev-839:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Ajshen</name></author>
	</entry>
	<entry>
		<id>https://info.stat.cmu.edu/index.php?title=Renv&amp;diff=13&amp;oldid=prev</id>
		<title>Skipper: Created page with &quot; Like &lt;code&gt;conda&lt;/code&gt; in &lt;code&gt;python&lt;/code&gt;, R has a package management tool (albeit less advanced), called [https://rstudio.github.io/renv/ &lt;code&gt;renv&lt;/code&gt;]. I personal...&quot;</title>
		<link rel="alternate" type="text/html" href="https://info.stat.cmu.edu/index.php?title=Renv&amp;diff=13&amp;oldid=prev"/>
		<updated>2024-03-29T23:42:50Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; Like &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;python&amp;lt;/code&amp;gt;, R has a package management tool (albeit less advanced), called [https://rstudio.github.io/renv/ &amp;lt;code&amp;gt;renv&amp;lt;/code&amp;gt;]. I personal...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
Like &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;python&amp;lt;/code&amp;gt;, R has a package management tool (albeit less advanced), called [https://rstudio.github.io/renv/ &amp;lt;code&amp;gt;renv&amp;lt;/code&amp;gt;]. I personally recommend having these for any package / set of tools you develop. I’m going to introduce it relative to a shiny app on our shiny server&amp;lt;ref&amp;gt;In the future I can imagine someone extending to this commentary with commentary relative to a &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt; package or at least a github repository - not just a set of files.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== 1. Motivation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;renv&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;conda&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;python&amp;lt;/code&amp;gt; are useful tools ([[Python virtual environments]]). They allow the user to more easily share code and not work about dependency issues for different people (recommended for consultant projects and group projects). Additionally, here at CMU Statistics and Data Science, if you’ve used&amp;amp;nbsp;the servers, you’ve probably experienced the server crash and remove all your &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt; libraries (or you’ve updated &amp;lt;code&amp;gt;Rstudio&amp;lt;/code&amp;gt; and a similar thing has occurred). &amp;#039;&amp;#039;&amp;#039;Enter the &amp;lt;code&amp;gt;renv&amp;lt;/code&amp;gt; package.&amp;#039;&amp;#039;&amp;#039; This package stores all your libraries, their versions and their dependencies.&lt;br /&gt;
&lt;br /&gt;
== 2. How to think about &amp;lt;code&amp;gt;renv&amp;lt;/code&amp;gt; workflow ==&lt;br /&gt;
&lt;br /&gt;
Below you’ll see a &amp;#039;&amp;#039;&amp;#039;getting started&amp;#039;&amp;#039;&amp;#039; example walkthrough. Something that may catch your eye is that the package updating and saving has similar structures and function names to &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; workflow (which you learned in Stat Computing).&lt;br /&gt;
&lt;br /&gt;
== 3. Getting started ==&lt;br /&gt;
&lt;br /&gt;
=== 3.1 Example directory ===&lt;br /&gt;
&lt;br /&gt;
Let’s suppose you already have a set of files going, (for this example, a shiny app). Specifically, in my Shiny app repository &amp;lt;code&amp;gt;36-350_shiny_files&amp;lt;/code&amp;gt; I have:&lt;br /&gt;
&amp;lt;pre&amp;gt;.&lt;br /&gt;
├── 36350&lt;br /&gt;
│&amp;amp;nbsp;&amp;amp;nbsp; ├── 350_syllabus.pdf&lt;br /&gt;
│&amp;amp;nbsp;&amp;amp;nbsp; ├── Homework&lt;br /&gt;
│&amp;amp;nbsp;&amp;amp;nbsp; │&amp;amp;nbsp;&amp;amp;nbsp; ├── hw_1-assign.Rmd&lt;br /&gt;
│&amp;amp;nbsp;&amp;amp;nbsp; │&amp;amp;nbsp;&amp;amp;nbsp; └── ...&lt;br /&gt;
│&amp;amp;nbsp;&amp;amp;nbsp; ├── Labs&lt;br /&gt;
│&amp;amp;nbsp;&amp;amp;nbsp; │&amp;amp;nbsp;&amp;amp;nbsp; ├── lab_1-assign.Rmd&lt;br /&gt;
│&amp;amp;nbsp;&amp;amp;nbsp; │&amp;amp;nbsp;&amp;amp;nbsp; └── ...&lt;br /&gt;
│&amp;amp;nbsp;&amp;amp;nbsp; └── Lectures&lt;br /&gt;
│&amp;amp;nbsp;&amp;amp;nbsp;     ├── 1.1_intro.Rmd&lt;br /&gt;
│&amp;amp;nbsp;&amp;amp;nbsp;  &amp;amp;nbsp;&amp;amp;nbsp; └── ...&lt;br /&gt;
└── app.R&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 3.2 &amp;lt;code&amp;gt;.renvignore&amp;lt;/code&amp;gt; (Ignoring files) ===&lt;br /&gt;
&lt;br /&gt;
Basically this is just a &amp;lt;code&amp;gt;shiny&amp;lt;/code&amp;gt;-based file sharing app (don’t ask why it exists). It contains &amp;lt;code&amp;gt;Rmd&amp;lt;/code&amp;gt; files and an &amp;lt;code&amp;gt;app.R&amp;lt;/code&amp;gt; file, but I really only want to make sure that I keep all my libraries need to make &amp;lt;code&amp;gt;app.R&amp;lt;/code&amp;gt; run correctly. To hide these other files, I create a &amp;lt;code&amp;gt;.renvignore&amp;lt;/code&amp;gt; file and make it look like the following.&lt;br /&gt;
&amp;lt;pre&amp;gt;36350/*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The syntax for this file is the exact same as a &amp;lt;code&amp;gt;.gitignore&amp;lt;/code&amp;gt; file and if you don’t make the &amp;lt;code&amp;gt;.renvignore&amp;lt;/code&amp;gt; file it will just use a &amp;lt;code&amp;gt;.gitignore&amp;lt;/code&amp;gt; file if you have one (see [https://rstudio.github.io/renv/reference/dependencies.html#ignoring-files Documenation of Ignoring files] for more details).&lt;br /&gt;
&lt;br /&gt;
=== 3.3 &amp;lt;code&amp;gt;renv::init()&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Now, in the shiny app directory, we can run&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;r&amp;quot;&amp;gt;library(renv)&lt;br /&gt;
renv::init()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our package this returned the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;r&amp;quot;&amp;gt;&amp;gt; renv::init()&lt;br /&gt;
* Initializing project ...&lt;br /&gt;
* Discovering package dependencies ... Done!&lt;br /&gt;
* Copying packages into the cache ... Done!&lt;br /&gt;
The following package(s) will be updated in the lockfile:&lt;br /&gt;
&lt;br /&gt;
# CRAN ===============================&lt;br /&gt;
- BH            [* -&amp;gt; 1.72.0-3]&lt;br /&gt;
- R6            [* -&amp;gt; 2.4.1]&lt;br /&gt;
- Rcpp          [* -&amp;gt; 1.0.5]&lt;br /&gt;
- assertthat    [* -&amp;gt; 0.2.1]&lt;br /&gt;
- cli           [* -&amp;gt; 2.0.2]&lt;br /&gt;
- crayon        [* -&amp;gt; 1.3.4]&lt;br /&gt;
- digest        [* -&amp;gt; 0.6.25]&lt;br /&gt;
- ellipsis      [* -&amp;gt; 0.3.1]&lt;br /&gt;
- fansi         [* -&amp;gt; 0.4.1]&lt;br /&gt;
- fastmap       [* -&amp;gt; 1.0.1]&lt;br /&gt;
- fs            [* -&amp;gt; 1.2.7]&lt;br /&gt;
- glue          [* -&amp;gt; 1.4.2]&lt;br /&gt;
- htmltools     [* -&amp;gt; 0.4.0]&lt;br /&gt;
- httpuv        [* -&amp;gt; 1.5.2]&lt;br /&gt;
- jsonlite      [* -&amp;gt; 1.6]&lt;br /&gt;
- later         [* -&amp;gt; 1.0.0]&lt;br /&gt;
- lifecycle     [* -&amp;gt; 0.2.0]&lt;br /&gt;
- magrittr      [* -&amp;gt; 1.5]&lt;br /&gt;
- mime          [* -&amp;gt; 0.6]&lt;br /&gt;
- pillar        [* -&amp;gt; 1.4.6]&lt;br /&gt;
- pkgconfig     [* -&amp;gt; 2.0.3]&lt;br /&gt;
- promises      [* -&amp;gt; 1.1.0]&lt;br /&gt;
- renv          [* -&amp;gt; 0.12.3]&lt;br /&gt;
- rlang         [* -&amp;gt; 0.4.7]&lt;br /&gt;
- shiny         [* -&amp;gt; 1.4.0]&lt;br /&gt;
- shinyFiles    [* -&amp;gt; 0.8.0]&lt;br /&gt;
- sourcetools   [* -&amp;gt; 0.1.7]&lt;br /&gt;
- tibble        [* -&amp;gt; 3.0.3]&lt;br /&gt;
- utf8          [* -&amp;gt; 1.1.4]&lt;br /&gt;
- vctrs         [* -&amp;gt; 0.3.4]&lt;br /&gt;
- xtable        [* -&amp;gt; 1.8-3]&lt;br /&gt;
&lt;br /&gt;
* Lockfile written to &amp;#039;~/ShinyApps/36-350_files/renv.lock&amp;#039;.&lt;br /&gt;
* Project &amp;#039;~/ShinyApps/36-350_files&amp;#039; loaded. [renv 0.12.3]&lt;br /&gt;
* renv activated -- please restart the R session.&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3.3.4 Package locations (not only CRAN) ====&lt;br /&gt;
&lt;br /&gt;
This shiny app’s code is rather basic, but note that it captures dependences (like &amp;lt;code&amp;gt;magrittr&amp;lt;/code&amp;gt; that I didn’t actually call in the app.). Additionally, it’s decided that all of these are from CRAN, but it can also &amp;#039;&amp;#039;&amp;#039;use packages that are not in CRAN&amp;#039;&amp;#039;&amp;#039; (see [https://rstudio.github.io/renv/articles/renv.html#package-sources-1 Package Sources] for options).&lt;br /&gt;
&lt;br /&gt;
==== 3.3.5 How it stores this information ====&lt;br /&gt;
&lt;br /&gt;
In the parent directory I also now have a file called &amp;lt;code&amp;gt;renv.lock&amp;lt;/code&amp;gt;, this is a yaml file with all the package and R information, and looks like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;{&lt;br /&gt;
  &amp;amp;quot;R&amp;amp;quot;: {&lt;br /&gt;
    &amp;amp;quot;Version&amp;amp;quot;: &amp;amp;quot;3.6.0&amp;amp;quot;,&lt;br /&gt;
    &amp;amp;quot;Repositories&amp;amp;quot;: [&lt;br /&gt;
      {&lt;br /&gt;
        &amp;amp;quot;Name&amp;amp;quot;: &amp;amp;quot;CRAN&amp;amp;quot;,&lt;br /&gt;
        &amp;amp;quot;URL&amp;amp;quot;: &amp;amp;quot;https://cloud.r-project.org&amp;amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    ]&lt;br /&gt;
  },&lt;br /&gt;
  &amp;amp;quot;Packages&amp;amp;quot;: {&lt;br /&gt;
    ...,&lt;br /&gt;
    &amp;amp;quot;shiny&amp;amp;quot;: {&lt;br /&gt;
      &amp;amp;quot;Package&amp;amp;quot;: &amp;amp;quot;shiny&amp;amp;quot;,&lt;br /&gt;
      &amp;amp;quot;Version&amp;amp;quot;: &amp;amp;quot;1.4.0&amp;amp;quot;,&lt;br /&gt;
      &amp;amp;quot;Source&amp;amp;quot;: &amp;amp;quot;Repository&amp;amp;quot;,&lt;br /&gt;
      &amp;amp;quot;Repository&amp;amp;quot;: &amp;amp;quot;CRAN&amp;amp;quot;,&lt;br /&gt;
      &amp;amp;quot;Hash&amp;amp;quot;: &amp;amp;quot;6ca23724bb2c804c1d0b3db4862a39c7&amp;amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    ...&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 3.4 &amp;lt;code&amp;gt;installing&amp;lt;/code&amp;gt; and understanding the &amp;lt;code&amp;gt;renv&amp;lt;/code&amp;gt; structure ===&lt;br /&gt;
&lt;br /&gt;
You should also note that you can see that I have the &amp;lt;code&amp;gt;shiny&amp;amp;nbsp;&amp;lt;/code&amp;gt;package, version &amp;lt;code&amp;gt;1.4.0&amp;lt;/code&amp;gt; defined in this initialization. At the time of writing this, &amp;lt;code&amp;gt;shiny&amp;lt;/code&amp;gt;, version &amp;lt;code&amp;gt;1.5.0&amp;lt;/code&amp;gt; is on CRAN. Let’ suppose I wish to update, &amp;lt;code&amp;gt;shiny&amp;lt;/code&amp;gt;, and run the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;r&amp;quot;&amp;gt;install.package(&amp;quot;shiny&amp;quot;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, I’ll ok up an R console in this directly, and it will state:&lt;br /&gt;
&amp;lt;pre&amp;gt;...&lt;br /&gt;
&lt;br /&gt;
Type &amp;#039;demo()&amp;#039; for some demos, &amp;#039;help()&amp;#039; for on-line help, or&lt;br /&gt;
&amp;#039;help.start()&amp;#039; for an HTML browser interface to help.&lt;br /&gt;
Type &amp;#039;q()&amp;#039; to quit R.&lt;br /&gt;
&lt;br /&gt;
* Project &amp;#039;~/ShinyApps/36-350_files&amp;#039; loaded. [renv 0.12.3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This final line tells me I do have an &amp;lt;code&amp;gt;renv&amp;lt;/code&amp;gt; available and active. I’ll run the installation file, and if I peek at the &amp;lt;code&amp;gt;renv.lock&amp;lt;/code&amp;gt; file it still is telling me I care about &amp;lt;code&amp;gt;shiny&amp;lt;/code&amp;gt;, version 1.4.0.&lt;br /&gt;
&lt;br /&gt;
==== 3.5 &amp;lt;code&amp;gt;renv::status&amp;lt;/code&amp;gt; checking which differences exist ====&lt;br /&gt;
&lt;br /&gt;
Like &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; I can check which packages differ in my &amp;lt;code&amp;gt;renv&amp;lt;/code&amp;gt; compared to the current packages loaded with &amp;lt;code&amp;gt;renv::status&amp;lt;/code&amp;gt; (and the following appears). This shows that &amp;lt;code&amp;gt;withr&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;commonmark&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;base64enc&amp;lt;/code&amp;gt; are new packages loaded by the update and &amp;lt;code&amp;gt;htmltools&amp;lt;/code&amp;gt; was also updated when I updated &amp;lt;code&amp;gt;shiny&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;r&amp;quot;&amp;gt;&amp;gt; renv::status()&lt;br /&gt;
The following package(s) are installed but not recorded in the lockfile:&lt;br /&gt;
             _&lt;br /&gt;
  withr        [2.3.0]&lt;br /&gt;
  commonmark   [1.7]&lt;br /&gt;
  base64enc    [0.1-3]&lt;br /&gt;
&lt;br /&gt;
Use `renv::snapshot()` to add these packages to your lockfile.&lt;br /&gt;
&lt;br /&gt;
The following package(s) are out of sync:&lt;br /&gt;
&lt;br /&gt;
   Package   Lockfile Version   Library Version&lt;br /&gt;
 htmltools              0.4.0             0.5.0&lt;br /&gt;
     shiny              1.4.0             1.5.0&lt;br /&gt;
&lt;br /&gt;
Use `renv::snapshot()` to save the state of your library to the lockfile.&lt;br /&gt;
Use `renv::restore()` to restore your library from the lockfile.&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 3.6 &amp;lt;code&amp;gt;renv::restore&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
Suppose I really like version 1.4 instead of 1.5 for &amp;lt;code&amp;gt;shiny&amp;lt;/code&amp;gt; (and my old snapshot). Then I can run:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;r&amp;quot;&amp;gt;renv::restore()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will ask me if I am sure I wish to revert, and then do so., getting me back to 1.4.0 for &amp;lt;code&amp;gt;shiny&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;r&amp;quot;&amp;gt;&amp;gt; utils::packageVersion(&amp;quot;shiny&amp;quot;)&lt;br /&gt;
[1] ‘1.4.0’&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What’s nice about this is that - &amp;lt;code&amp;gt;renv::restore&amp;lt;/code&amp;gt; should also restore my &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt; package environment (aka &amp;lt;code&amp;gt;renv&amp;lt;/code&amp;gt;&amp;amp;nbsp;:P ), if the server crashes and removes all my packages.&lt;br /&gt;
&lt;br /&gt;
==== 3.7 creating a new snapshot (&amp;lt;code&amp;gt;renv::snapshot&amp;lt;/code&amp;gt;) ====&lt;br /&gt;
&lt;br /&gt;
Let’s instead imagine I did actually want to snapshot/update &amp;lt;code&amp;gt;shiny&amp;lt;/code&amp;gt; for my environment. Then (after reinstalling &amp;lt;code&amp;gt;shiny&amp;lt;/code&amp;gt; 1.5.0), I can instead do&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;r&amp;quot;&amp;gt;renv::snapshot()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which will again ask if I’m sure and then update the &amp;lt;code&amp;gt;renv.lock&amp;lt;/code&amp;gt; file to include my new packages (so if I run &amp;lt;code&amp;gt;renv::status&amp;lt;/code&amp;gt; I’ll see the new package versions).&lt;br /&gt;
&lt;br /&gt;
==== 3.8 smart &amp;lt;code&amp;gt;renv&amp;lt;/code&amp;gt; tools ====&lt;br /&gt;
&lt;br /&gt;
Every time you reopen your directory in &amp;lt;code&amp;gt;R&amp;lt;/code&amp;gt; it will do a check to tell you if you have any packages that don’t align with your &amp;lt;code&amp;gt;renv&amp;lt;/code&amp;gt; - you can then correct that with a &amp;lt;code&amp;gt;renv::restore()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;renv::snapshot()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== 4. Other resources ==&lt;br /&gt;
&lt;br /&gt;
*[https://environments.rstudio.com/ &amp;lt;code&amp;gt;Rstudio&amp;lt;/code&amp;gt; on Reprodicible Environments] &lt;br /&gt;
*[https://www.milesmcbain.com/posts/the-drake-post/ Miles McBain on &amp;lt;code&amp;gt;drake&amp;lt;/code&amp;gt; workflow]: probably more for data science pipelines than code you’ll work on in grad school &lt;br /&gt;
*[https://www.milesmcbain.com/posts/packrat-lite/ Miles McBain on motivation for &amp;lt;code&amp;gt;packrat&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;renv&amp;lt;/code&amp;gt; is the “2.0” of &amp;lt;code&amp;gt;packrat&amp;lt;/code&amp;gt;)] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Skipper</name></author>
	</entry>
</feed>