Skip to content

Commit 3acc775

Browse files
committed
edits to chapter 6
1 parent 5cfb815 commit 3acc775

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

06-package-management.Rmd

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ As we discussed previously, sometimes two different researchers can run the same
1717
ottrpal::include_slide("https://docs.google.com/presentation/d/1LMurysUhCjZb7DVF6KS9QmJ5NBjwWVjRn40MS9f2noE/edit#slide=id.gf1accd298e_0_673")
1818
```
1919

20-
What Ruby and Avi may not realize is that although they may have used the same code and data, the software packages that they have on each of their computers might be very different. Even if they have the same software packages, they likely don't have the same versions and versions can influence results! Different computing environments are not only a headache to detangle, they also can influence the reproducibility of your results [ @BeaulieuJones2017].
20+
What Ruby and Avi may not realize is that although they have used the same code and data, the software packages that they have on each of their computers may be very different. Even if they have the same software packages, they likely don't have the same package versions and these versions can influence results! Different computing environments are not only a headache to detangle, they also can influence the reproducibility of your results [ @BeaulieuJones2017].
2121

2222
```{r, fig.alt="Ruby has a particular computing environment she has developed her code from. This computing environment is represented as a bubble above her computer with various hexagons with version numbers as well as Rstudio and R installed on her computer. Her code ran just fine on her particular computing environment. Avi attempted to run Ruby’s code on his very different local computing environment and got an error. His computer runs the same code but came up with a different result!", out.width = "100%", echo = FALSE}
2323
ottrpal::include_slide("https://docs.google.com/presentation/d/1LMurysUhCjZb7DVF6KS9QmJ5NBjwWVjRn40MS9f2noE/edit#slide=id.gf62875ddf7_0_404")
@@ -29,19 +29,19 @@ There are two strategies for dealing with software versions that we will discuss
2929

3030
### Strategy 1: Session Info - record a list of your packages
3131

32-
One strategy to combat different software versions is to list the **session info**. This is the easiest (though not most comprehensive) method for handling differences in software versions is to have your code list details about your computing environment.
32+
One strategy to combat different software versions is to list the **session info**. The easiest (though not most comprehensive) method for handling differences in software versions is to have your code list details about your computing environment.
3333

34-
Session info can lead to clues as to why results weren't reproducible. For example, if both Avi and Ruby ran notebooks and included a session info print out it may look like this:
34+
Session info can lead to clues as to why results weren't reproducible. For example, if both Avi and Ruby ran notebooks, and included a session info print out, it may look like this:
3535

36-
```{r, fig.alt="Two session info print outs are show side by side. One is labeled as ‘Ruby’s session info print out’ and the other as ‘Avi’s session info print out’. Highlighted we can see that they have different R versions: 4.0.2 vs 4.0.5. They also have different operating systems. The packages they have attached is rmarkdown but they also have different rmarkdown package versions! If Avi and Ruby have discrepancies in their results, the session info print out gives a record which may have clues to why that might be! This can give them items to look into for determining why the results didn’t reproduce as expected.", out.width = "100%", echo = FALSE}
36+
```{r, fig.alt="Two session info print outs are show side by side. One is labeled as ‘Ruby’s session info print out’ and the other as ‘Avi’s session info print out’. Highlighted we can see that they have different R versions: 4.0.2 vs 4.0.5. They also have different operating systems. The packages they have attached is rmarkdown but they also have different rmarkdown package versions! If Avi and Ruby have discrepancies in their results, the session info print out gives a record which may have clues as to why that might be! This can suggest items to look into for determining why the results didn’t reproduce as expected.", out.width = "100%", echo = FALSE}
3737
ottrpal::include_slide("https://docs.google.com/presentation/d/1LMurysUhCjZb7DVF6KS9QmJ5NBjwWVjRn40MS9f2noE/edit#slide=id.g102dc56db08_0_0")
3838
```
3939

4040
Session info shows us that they have different R versions and different operating systems. The packages they have attached is rmarkdown but they also have different rmarkdown package versions. If Avi and Ruby have discrepancies in their results, the session info print out gives a record which may have clues for any discrepancies. This can give them items to look into for determining why the results didn’t reproduce as expected.
4141

4242
### Strategy 2: Package managers - share a useable snapshot of your environment
4343

44-
**Package managers** can help handle your computing environment for you in a way that you can share them with others. In general, package managers work by capturing a snapshot of the environment and when that environment snapshot is shared, it attempt to rebuild it. For R and Python versions of the exercises, we will be using different managers, but the foundational strategy will be the same: include a file that someone else could replicate your package set up from.
44+
**Package managers** can help handle your computing environment for you in a way so that you can share it with others. In general, package managers work by capturing a snapshot of the environment and when that environment snapshot is shared, it attempts to rebuild it. For R and Python versions of the exercises, we will be using different managers, but the foundational strategy will be the same: include a file that someone else could replicate your package setup from.
4545

4646
```{r, fig.alt="In general, package managers work by capturing a snapshot of the environment and when that environment snapshot is shared, it attempt to rebuild it. In this example we show that Ruby has an environment, and using a package manager, has taken a snapshot of her computing environment. That snapshot is shared with Avi, who can use the package manager to attempt to build it on his own computer. This will help address some differences in package versions between two individual’s computers.", out.width = "100%", echo = FALSE}
4747
ottrpal::include_slide("https://docs.google.com/presentation/d/1LMurysUhCjZb7DVF6KS9QmJ5NBjwWVjRn40MS9f2noE/edit#slide=id.g102dc56db08_49_26")
@@ -98,11 +98,10 @@ In your scientific notebook, you'll need to add two items.
9898
<details> <summary>**R version of the exercise**</summary>
9999

100100
1. In your Rmd file, add a chunk in the very end that looks like this:
101-
`````
102101
```{r}
103102
sessionInfo()
104103
```
105-
`````
104+
106105
2. Save your notebook as is. Note it will not run correctly until we address the issues with the code in the next chapter.
107106

108107
</details>
@@ -151,7 +150,7 @@ jupyter lab
151150

152151
1. Go to RStudio and the Console pane:
153152

154-
2. Install `renv` using (you should only need to do this once per your computer or RStudio environment).
153+
2. Install `renv` using the command below (you should only need to do this once per your computer or RStudio environment).
155154

156155
```
157156
install.packages("renv")

0 commit comments

Comments
 (0)