Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from swcarpentry:main #44

Closed
wants to merge 8 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

This directory contains workflows to be used for Lessons using the {sandpaper}
lesson infrastructure. Two of these workflows require R (`sandpaper-main.yaml`
and `pr-recieve.yaml`) and the rest are bots to handle pull request management.
and `pr-receive.yaml`) and the rest are bots to handle pull request management.

These workflows will likely change as {sandpaper} evolves, so it is important to
keep them up-to-date. To do this in your lesson you can do the following in your
@@ -94,7 +94,7 @@ branch called `update/workflows` and a pull request is created. Maintainers are
encouraged to review the changes and accept the pull request if the outputs
are okay.

This update is run ~~weekly or~~ on demand.
This update is run weekly or on demand.

### 03 Maintain: Update Package Cache (update-cache.yaml)

@@ -140,7 +140,7 @@ Once the checks are finished, a comment is issued to the pull request, which
will allow maintainers to determine if it is safe to run the
"Receive Pull Request" workflow from new contributors.

### Recieve Pull Request (pr-recieve.yaml)
### Receive Pull Request (pr-receive.yaml)

**Note of caution:** This workflow runs arbitrary code by anyone who creates a
pull request. GitHub has safeguarded the token used in this workflow to have no
@@ -171,7 +171,7 @@ The artifacts produced are used by the next workflow.

### Comment on Pull Request (pr-comment.yaml)

This workflow is triggered if the `pr-recieve.yaml` workflow is successful.
This workflow is triggered if the `pr-receive.yaml` workflow is successful.
The steps in this workflow are:

1. Test if the workflow is valid and comment the validity of the workflow to the
2 changes: 1 addition & 1 deletion .github/workflows/sandpaper-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.14.1
0.16.5
15 changes: 7 additions & 8 deletions episodes/08-plot-ggplot2.Rmd
Original file line number Diff line number Diff line change
@@ -270,18 +270,15 @@ ggplot(data = gapminder, mapping = aes(x = gdpPercap, y = lifeExp)) +
geom_point(alpha = 0.5) + scale_x_log10() + geom_smooth(method="lm")
```

We can make the line thicker by *setting* the **size** aesthetic in the
We can make the line thicker by *setting* the **linewidth** aesthetic in the
`geom_smooth` layer:

```{r lm-fit2, fig.alt="Scatter plot of life expectancy vs GDP per capita with a trend line summarising the relationship between variables. The blue trend line is slightly thicker than in the previous figure."}
ggplot(data = gapminder, mapping = aes(x = gdpPercap, y = lifeExp)) +
geom_point(alpha = 0.5) + scale_x_log10() + geom_smooth(method="lm", size=1.5)
geom_point(alpha = 0.5) + scale_x_log10() + geom_smooth(method="lm", linewidth=1.5)
```

There are two ways an *aesthetic* can be specified. Here we *set* the **size**
aesthetic by passing it as an argument to `geom_smooth`. Previously in the
lesson we've used the `aes` function to define a *mapping* between data
variables and their visual representation.
There are two ways an *aesthetic* can be specified. Here we *set* the **linewidth** aesthetic by passing it as an argument to `geom_smooth` and it is applied the same to the whole `geom`. Previously in the lesson we've used the `aes` function to define a *mapping* between data variables and their visual representation.

::::::::::::::::::::::::::::::::::::::: challenge

@@ -292,6 +289,8 @@ example.

Hint: do not use the `aes` function.

Hint: the equivalent of `linewidth` for points is `size`.

::::::::::::::: solution

## Solution to challenge 4a
@@ -304,7 +303,7 @@ a specific variable.
```{r ch4a-sol, fig.alt="Scatter plot of life expectancy vs GDP per capita with a trend line summarising the relationship between variables. The plot illustrates the possibilities for styling visualisations in ggplot2 with data points enlarged, coloured orange, and displayed without transparency."}
ggplot(data = gapminder, mapping = aes(x = gdpPercap, y = lifeExp)) +
geom_point(size=3, color="orange") + scale_x_log10() +
geom_smooth(method="lm", size=1.5)
geom_smooth(method="lm", linewidth=1.5)
```

:::::::::::::::::::::::::
@@ -332,7 +331,7 @@ is placed inside the `aes()` call modifies a point's color based on its continen
```{r ch4b-sol}
ggplot(data = gapminder, mapping = aes(x = gdpPercap, y = lifeExp, color = continent)) +
geom_point(size=3, shape=17) + scale_x_log10() +
geom_smooth(method="lm", size=1.5)
geom_smooth(method="lm", linewidth=1.5)
```

:::::::::::::::::::::::::
70 changes: 35 additions & 35 deletions renv/profiles/lesson-requirements/renv.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"R": {
"Version": "4.3.3",
"Version": "4.4.1",
"Repositories": [
{
"Name": "carpentries",
@@ -47,7 +47,7 @@
},
"MASS": {
"Package": "MASS",
"Version": "7.3-60.0.1",
"Version": "7.3-61",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
@@ -58,11 +58,11 @@
"stats",
"utils"
],
"Hash": "b765b28387acc8ec9e9c1530713cb19c"
"Hash": "0cafd6f0500e5deba33be22c46bf6055"
},
"Matrix": {
"Package": "Matrix",
"Version": "1.6-5",
"Version": "1.7-0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
@@ -75,7 +75,7 @@
"stats",
"utils"
],
"Hash": "8c7115cd3a0e048bda2a7cd110549f7a"
"Hash": "1920b2f11133b12350024297d8a4ff4a"
},
"R6": {
"Package": "R6",
@@ -155,25 +155,25 @@
},
"cachem": {
"Package": "cachem",
"Version": "1.0.8",
"Version": "1.1.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"fastmap",
"rlang"
],
"Hash": "c35768291560ce302c0a6589f92e837d"
"Hash": "cd9a672193789068eb5a2aad65a0dedf"
},
"cli": {
"Package": "cli",
"Version": "3.6.2",
"Version": "3.6.3",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"utils"
],
"Hash": "1216ac65ac55ec0058a6f75d7ca0fd52"
"Hash": "b21916dd77a27642b447374a5d30ecf3"
},
"clipr": {
"Package": "clipr",
@@ -211,26 +211,26 @@
},
"crayon": {
"Package": "crayon",
"Version": "1.5.2",
"Version": "1.5.3",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"grDevices",
"methods",
"utils"
],
"Hash": "e8a1e41acf02548751f45c718d55aa6a"
"Hash": "859d96e65ef198fd43e82b9628d593ef"
},
"digest": {
"Package": "digest",
"Version": "0.6.35",
"Version": "0.6.36",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"utils"
],
"Hash": "698ece7ba5a4fa4559e3d537e7ec3d31"
"Hash": "fd6824ad91ede64151e93af67df6376b"
},
"dplyr": {
"Package": "dplyr",
@@ -257,14 +257,14 @@
},
"evaluate": {
"Package": "evaluate",
"Version": "0.23",
"Version": "0.24.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"methods"
],
"Hash": "daf4a1246be12c1fa8c7705a0935c1a0"
"Hash": "a1066cbc05caee9a4bf6d90f194ff4da"
},
"fansi": {
"Package": "fansi",
@@ -280,17 +280,17 @@
},
"farver": {
"Package": "farver",
"Version": "2.1.1",
"Version": "2.1.2",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "8106d78941f34855c440ddb946b8f7a5"
"Hash": "680887028577f3fa2a81e410ed0d6e42"
},
"fastmap": {
"Package": "fastmap",
"Version": "1.1.1",
"Version": "1.2.0",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "f7736a18de97dea803bde0a2daaafb27"
"Hash": "aa5e1cd11c2d15497494c5292d7ffcc8"
},
"fontawesome": {
"Package": "fontawesome",
@@ -379,14 +379,14 @@
},
"highr": {
"Package": "highr",
"Version": "0.10",
"Version": "0.11",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"xfun"
],
"Hash": "06230136b2d2b9ba5805e1963fa6e890"
"Hash": "d65ba49117ca223614f71b60d85b8ab7"
},
"hms": {
"Package": "hms",
@@ -489,7 +489,7 @@
},
"knitr": {
"Package": "knitr",
"Version": "1.46",
"Version": "1.47",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
@@ -501,7 +501,7 @@
"xfun",
"yaml"
],
"Hash": "6e008ab1d696a5283c79765fa7b56b47"
"Hash": "7c99b2d55584b982717fcc0950378612"
},
"labeling": {
"Package": "labeling",
@@ -603,17 +603,17 @@
},
"nlme": {
"Package": "nlme",
"Version": "3.1-164",
"Version": "3.1-165",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"graphics",
"lattice",
"stats",
"utils"
],
"Hash": "a623a2239e642806158bc4dc3f51565d"
"Hash": "2769a88be217841b1f33ed469675c3cc"
},
"pillar": {
"Package": "pillar",
@@ -726,18 +726,18 @@
},
"rlang": {
"Package": "rlang",
"Version": "1.1.3",
"Version": "1.1.4",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"utils"
],
"Hash": "42548638fae05fd9a9b5f3f437fbbbe2"
"Hash": "3eec01f8b1dee337674b2e34ab1f9bc1"
},
"rmarkdown": {
"Package": "rmarkdown",
"Version": "2.26",
"Version": "2.27",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
@@ -756,7 +756,7 @@
"xfun",
"yaml"
],
"Hash": "9b148e7f95d33aac01f31282d49e4f44"
"Hash": "27f9502e1cdbfa195f94e03b0f517484"
},
"rstudioapi": {
"Package": "rstudioapi",
@@ -803,7 +803,7 @@
"Package": "stringi",
"Version": "1.8.4",
"Source": "Repository",
"Repository": "carpentries",
"Repository": "RSPM",
"Requirements": [
"R",
"stats",
@@ -1000,15 +1000,15 @@
},
"xfun": {
"Package": "xfun",
"Version": "0.43",
"Version": "0.45",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"grDevices",
"stats",
"tools"
],
"Hash": "ab6371d8653ce5f2f9290f4ec7b42a8e"
"Hash": "ca59c87fe305b16a9141a5874c3a7889"
},
"yaml": {
"Package": "yaml",
Loading