Skip to content

Commit 1f7b973

Browse files
committed
markdown source builds
Auto-generated via `{sandpaper}` Source : 97a6310 Branch : master Author : Craig Grosch <[email protected]> Time : 2026-01-07 23:02:18 +0000 Message : Merge pull request swcarpentry#938 from swcarpentry/update/packages Update 16 packages
1 parent 61a9f62 commit 1f7b973

15 files changed

+71
-2804
lines changed

01-rstudio-intro.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ function (name, pos = -1L, envir = as.environment(pos), all.names = FALSE,
643643
}
644644
else all.names
645645
}
646-
<bytecode: 0x55cc871b9fd0>
646+
<bytecode: 0x559f3e4abf90>
647647
<environment: namespace:base>
648648
```
649649

@@ -695,7 +695,8 @@ rm(list <- ls())
695695
```
696696

697697
``` error
698-
Error in rm(list <- ls()): ... must contain names or character strings
698+
Error in `rm()`:
699+
! ... must contain names or character strings
699700
```
700701

701702
::::::::::::::::::::::::::::::::::::::::: callout

02-project-intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ ls -lh data/gapminder_data.csv
190190
```
191191

192192
``` output
193-
-rw-r--r-- 1 runner runner 80K Nov 11 01:04 data/gapminder_data.csv
193+
-rw-r--r-- 1 runner runner 80K Jan 20 01:02 data/gapminder_data.csv
194194
```
195195

196196
The file size is 80K.

03-seeking-help.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ attached base packages:
186186
[1] stats graphics grDevices utils datasets methods base
187187
188188
loaded via a namespace (and not attached):
189-
[1] compiler_4.5.2 tools_4.5.2 yaml_2.3.10 knitr_1.50 xfun_0.53
190-
[6] renv_1.1.5 evaluate_1.0.5
189+
[1] compiler_4.5.2 cli_3.6.5 tools_4.5.2 yaml_2.3.12 knitr_1.51
190+
[6] xfun_0.55 rlang_1.1.6 renv_1.1.6 evaluate_1.0.5
191191
```
192192

193193
Will print out your current version of R, as well as any packages you

04-data-structures-part1.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ cats$weight + cats$coat
168168
```
169169

170170
``` error
171-
Error in cats$weight + cats$coat: non-numeric argument to binary operator
171+
Error in `cats$weight + cats$coat`:
172+
! non-numeric argument to binary operator
172173
```
173174

174175
Understanding what happened here is key to successfully analyzing data in R.
@@ -284,7 +285,8 @@ cats2$weight + 2
284285
```
285286

286287
``` error
287-
Error in cats2$weight + 2: non-numeric argument to binary operator
288+
Error in `cats2$weight + 2`:
289+
! non-numeric argument to binary operator
288290
```
289291

290292
What happened?
@@ -975,7 +977,8 @@ pizza_price$pizzafresh
975977
```
976978

977979
``` error
978-
Error in pizza_price$pizzafresh: $ operator is invalid for atomic vectors
980+
Error in `pizza_price$pizzafresh`:
981+
! $ operator is invalid for atomic vectors
979982
```
980983

981984
It will pay off if you remember this error message, you will meet it in your own

05-data-structures-part2.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ cbind(cats, age)
7070
```
7171

7272
``` error
73-
Error in data.frame(..., check.names = FALSE): arguments imply differing number of rows: 3, 4
73+
Error in `data.frame()`:
74+
! arguments imply differing number of rows: 3, 4
7475
```
7576

7677
``` r
@@ -79,7 +80,8 @@ cbind(cats, age)
7980
```
8081

8182
``` error
82-
Error in data.frame(..., check.names = FALSE): arguments imply differing number of rows: 3, 2
83+
Error in `data.frame()`:
84+
! arguments imply differing number of rows: 3, 2
8385
```
8486

8587
Why didn't this work? Of course, R wants to see one element in our new column

06-data-subsetting.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ This gives a somewhat cryptic error:
215215

216216

217217
``` error
218-
Error in x[-1:3]: only 0's may be mixed with negative subscripts
218+
Error in `x[-1:3]`:
219+
! only 0's may be mixed with negative subscripts
219220
```
220221

221222
But remember the order of operations. `:` is really a function.
@@ -522,7 +523,8 @@ x[-"a"]
522523
```
523524

524525
``` error
525-
Error in -"a": invalid argument to unary operator
526+
Error in `-"a"`:
527+
! invalid argument to unary operator
526528
```
527529

528530
However, we can use the `!=` (not-equals) operator to construct a logical vector that will do what we want:
@@ -795,7 +797,8 @@ m[, c(3,6)]
795797
```
796798

797799
``` error
798-
Error in m[, c(3, 6)]: subscript out of bounds
800+
Error in `m[, c(3, 6)]`:
801+
! subscript out of bounds
799802
```
800803

801804
::::::::::::::::::::::::::::::::::::::::: callout
@@ -954,7 +957,8 @@ xlist[[1:2]]
954957
```
955958

956959
``` error
957-
Error in xlist[[1:2]]: subscript out of bounds
960+
Error in `xlist[[1:2]]`:
961+
! subscript out of bounds
958962
```
959963

960964
Nor use it to skip elements:
@@ -965,7 +969,8 @@ xlist[[-1]]
965969
```
966970

967971
``` error
968-
Error in xlist[[-1]]: invalid negative subscript in get1index <real>
972+
Error in `xlist[[-1]]`:
973+
! invalid negative subscript in get1index <real>
969974
```
970975

971976
But you can use names to both subset and extract elements:

07-control-flow.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ Did anyone get a warning message like this?
187187

188188

189189
``` error
190-
Error in if (gapminder$year == 2012) {: the condition has length > 1
190+
Error in `if (gapminder$year == 2012) ...`:
191+
! the condition has length > 1
191192
```
192193

193194
The `if()` function only accepts singular (of length 1) inputs, and therefore

08-plot-ggplot2.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ ggplot(data = gapminder, mapping = aes(x=year, y=lifeExp, color=continent)) +
185185
geom_line()
186186
```
187187

188-
<img src="fig/08-plot-ggplot2-rendered-lifeExp-line-1.png" style="display: block; margin: auto;" />
188+
<img src="fig/08-plot-ggplot2-rendered-lifeExp-line-1.png" alt="" style="display: block; margin: auto;" />
189189

190190
Instead of adding a `geom_point` layer, we've added a `geom_line` layer.
191191

@@ -197,7 +197,7 @@ ggplot(data = gapminder, mapping = aes(x=year, y=lifeExp, group=country, color=c
197197
geom_line()
198198
```
199199

200-
<img src="fig/08-plot-ggplot2-rendered-lifeExp-line-by-1.png" style="display: block; margin: auto;" />
200+
<img src="fig/08-plot-ggplot2-rendered-lifeExp-line-by-1.png" alt="" style="display: block; margin: auto;" />
201201

202202
We've added the **group** *aesthetic*, which tells `ggplot` to draw a line for each
203203
country.
@@ -211,7 +211,7 @@ ggplot(data = gapminder, mapping = aes(x=year, y=lifeExp, group=country, color=c
211211
geom_line() + geom_point()
212212
```
213213

214-
<img src="fig/08-plot-ggplot2-rendered-lifeExp-line-point-1.png" style="display: block; margin: auto;" />
214+
<img src="fig/08-plot-ggplot2-rendered-lifeExp-line-point-1.png" alt="" style="display: block; margin: auto;" />
215215

216216
It's important to note that each layer is drawn on top of the previous layer. In
217217
this example, the points have been drawn *on top of* the lines. Here's a
@@ -223,7 +223,7 @@ ggplot(data = gapminder, mapping = aes(x=year, y=lifeExp, group=country)) +
223223
geom_line(mapping = aes(color=continent)) + geom_point()
224224
```
225225

226-
<img src="fig/08-plot-ggplot2-rendered-lifeExp-layer-example-1-1.png" style="display: block; margin: auto;" />
226+
<img src="fig/08-plot-ggplot2-rendered-lifeExp-layer-example-1-1.png" alt="" style="display: block; margin: auto;" />
227227

228228
In this example, the *aesthetic* mapping of **color** has been moved from the
229229
global plot options in `ggplot` to the `geom_line` layer so it no longer applies
@@ -275,7 +275,7 @@ ggplot(data = gapminder, mapping = aes(x = gdpPercap, y = lifeExp)) +
275275
geom_point()
276276
```
277277

278-
<img src="fig/08-plot-ggplot2-rendered-lifeExp-vs-gdpPercap-scatter3-1.png" style="display: block; margin: auto;" />
278+
<img src="fig/08-plot-ggplot2-rendered-lifeExp-vs-gdpPercap-scatter3-1.png" alt="" style="display: block; margin: auto;" />
279279

280280
Currently it's hard to see the relationship between the points due to some strong
281281
outliers in GDP per capita. We can change the scale of units on the x axis using
@@ -404,7 +404,7 @@ ggplot(data = gapminder, mapping = aes(x = gdpPercap, y = lifeExp, color = conti
404404
`geom_smooth()` using formula = 'y ~ x'
405405
```
406406

407-
<img src="fig/08-plot-ggplot2-rendered-ch4b-sol-1.png" style="display: block; margin: auto;" />
407+
<img src="fig/08-plot-ggplot2-rendered-ch4b-sol-1.png" alt="" style="display: block; margin: auto;" />
408408

409409
:::::::::::::::::::::::::
410410

@@ -438,7 +438,7 @@ ggplot(data = americas, mapping = aes(x = year, y = lifeExp)) +
438438
theme(axis.text.x = element_text(angle = 45))
439439
```
440440

441-
<img src="fig/08-plot-ggplot2-rendered-facet-1.png" style="display: block; margin: auto;" />
441+
<img src="fig/08-plot-ggplot2-rendered-facet-1.png" alt="" style="display: block; margin: auto;" />
442442

443443
The `facet_wrap` layer took a "formula" as its argument, denoted by the tilde
444444
(~). This tells R to draw a panel for each unique value in the country column
@@ -470,7 +470,7 @@ ggplot(data = americas, mapping = aes(x = year, y = lifeExp, color=continent)) +
470470
theme(axis.text.x = element_text(angle = 90, hjust = 1))
471471
```
472472

473-
<img src="fig/08-plot-ggplot2-rendered-theme-1.png" style="display: block; margin: auto;" />
473+
<img src="fig/08-plot-ggplot2-rendered-theme-1.png" alt="" style="display: block; margin: auto;" />
474474

475475
## Exporting the plot
476476

@@ -531,7 +531,7 @@ ggplot(data = gapminder, mapping = aes(x = continent, y = lifeExp, fill = contin
531531
axis.ticks.x = element_blank())
532532
```
533533

534-
<img src="fig/08-plot-ggplot2-rendered-ch5-sol-1.png" style="display: block; margin: auto;" />
534+
<img src="fig/08-plot-ggplot2-rendered-ch5-sol-1.png" alt="" style="display: block; margin: auto;" />
535535

536536
:::::::::::::::::::::::::
537537

10-functions.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ fahr_to_kelvin(temp = as.factor(32))
291291
```
292292

293293
``` error
294-
Error in fahr_to_kelvin(temp = as.factor(32)): is.numeric(temp) is not TRUE
294+
Error in `fahr_to_kelvin()`:
295+
! is.numeric(temp) is not TRUE
295296
```
296297

297298
::::::::::::::::::::::::::::::::::::::: challenge

12-dplyr.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ ggplot(data = americas, mapping = aes(x = year, y = lifeExp)) +
582582
theme(axis.text.x = element_text(angle = 45))
583583
```
584584

585-
<img src="fig/12-dplyr-rendered-unnamed-chunk-27-1.png" style="display: block; margin: auto;" />
585+
<img src="fig/12-dplyr-rendered-unnamed-chunk-27-1.png" alt="" style="display: block; margin: auto;" />
586586

587587
This code makes the right plot but it also creates an intermediate variable
588588
(`americas`) that we might not have any other uses for. Just as we used
@@ -604,7 +604,7 @@ gapminder %>%
604604
theme(axis.text.x = element_text(angle = 45))
605605
```
606606

607-
<img src="fig/12-dplyr-rendered-unnamed-chunk-28-1.png" style="display: block; margin: auto;" />
607+
<img src="fig/12-dplyr-rendered-unnamed-chunk-28-1.png" alt="" style="display: block; margin: auto;" />
608608

609609
More examples of using the function `mutate()` and the `ggplot2` package.
610610

@@ -622,7 +622,7 @@ gapminder %>%
622622
theme_minimal()
623623
```
624624

625-
<img src="fig/12-dplyr-rendered-unnamed-chunk-29-1.png" style="display: block; margin: auto;" />
625+
<img src="fig/12-dplyr-rendered-unnamed-chunk-29-1.png" alt="" style="display: block; margin: auto;" />
626626

627627
::::::::::::::::::::::::::::::::::::::: challenge
628628

0 commit comments

Comments
 (0)