Skip to content

Commit

Permalink
Merge pull request #23 from posit-conf-2024/chore/iteration-01-update
Browse files Browse the repository at this point in the history
Chore/iteration 01 update
  • Loading branch information
3mmaRand authored Aug 11, 2024
2 parents fcccd68 + c210037 commit 4f87c19
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions 03-iteration-01.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ other languages, a for loop would be right after hello world
```{r}
#| eval: false
usethis::use_r("functions-01")
usethis::use_r("iteration-01")
```

## Packages
Expand All @@ -125,18 +125,6 @@ library(tidyverse)
library(palmerpenguins)
```

```
── Attaching core tidyverse packages ──────────────────────────────────────────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.2 ✔ readr 2.1.4
✔ forcats 1.0.0 ✔ stringr 1.5.0
✔ ggplot2 3.4.2 ✔ tibble 3.2.1
✔ lubridate 1.9.2 ✔ tidyr 1.3.0
✔ purrr 1.0.1 ── Conflicts ────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package to force all conflicts to become errors'
```

## Load `penguins`

🎬 Load `penguins` data set
Expand Down Expand Up @@ -375,7 +363,7 @@ penguins |>

. . .

- `\(x)` is base syntax new in in 4.1.0 **Recommended**
- `\(x)` is base syntax new in 4.1.0 **Recommended**

- `~ .x` is fine but only works in tidyverse functions

Expand All @@ -399,8 +387,8 @@ Using a list:
``` r
penguins |>
summarise(across(where(is.numeric), list(
sd_error,
length)))
sd_error,
length)))
```

. . .
Expand Down Expand Up @@ -589,7 +577,7 @@ penguins |>
- `across()` iterates over columns

- choose columns with familiar `select()` spec
- pass functions without their `()\`
- pass functions without their `()`
- use anonymous functions to add arguments
- use a list to use multiple functions
- specify the names
Expand Down

0 comments on commit 4f87c19

Please sign in to comment.