Skip to content

Commit

Permalink
fixed typos in decks 1 and 2
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrod61 committed Jun 1, 2024
1 parent 42e2c79 commit f4b6dfe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion slides/01-r-pkg-intro.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ mtcars |>
## Packaging our code

::: incremental
- Allows us to more easily reuse the in many different projects, in a less error-prone way
- Allows us to more easily reuse it in many different projects, in a less error-prone way
- Lets others benefit from the code we have written
- Increases our code quality because when packaging we:
- must <span style="color: purple;">modularize</span> our code into functions and write function reference documentation
Expand Down
8 changes: 4 additions & 4 deletions slides/02-build-first-pkg.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ count_classes <- function(data_frame, class_col) {

### Syntax `package::function()`

- `count_classes()` includes three <span style="color: darkblue;">{dplyr}</span> functions:
- `group_by()`, `summarize()`, and `rename()`
- Alternatively, we can use the syntax `dplyr::group_by()`, `dplyr::summarize()`, and `dplyr::rename()`
- `count_classes()` includes four <span style="color: darkblue;">{dplyr}</span> functions:
- `group_by()`, `summarize()`, `n()`, and `rename()`
- Alternatively, we can use the syntax `dplyr::group_by()`, `dplyr::summarize()`, `dplyr::n()`, and `dplyr::rename()`
- This syntax is recommended since it makes explicit which package each dependency is coming from within our package functions

### Re-writing our function
Expand All @@ -195,7 +195,7 @@ count_classes <- function(data_frame, class_col) {
data_frame |>
dplyr::group_by({{ class_col }}) |>
dplyr::summarize(count = n()) |>
dplyr::summarize(count = dplyr::n()) |>
dplyr::rename("class" = {{ class_col }})
}
```
Expand Down

0 comments on commit f4b6dfe

Please sign in to comment.