Fix code formatting
This commit is contained in:
parent
77c95b7c0c
commit
c5b7811645
|
@ -428,7 +428,7 @@ The final member of the apply family is the titular `apply()`, which works with
|
||||||
In particular, watch out for `apply(df, 2, something)`, which is a slow and potentially dangerous way of doing `lapply(df, something)`.
|
In particular, watch out for `apply(df, 2, something)`, which is a slow and potentially dangerous way of doing `lapply(df, something)`.
|
||||||
This rarely comes up in data science because we usually work with data frames and not matrices.
|
This rarely comes up in data science because we usually work with data frames and not matrices.
|
||||||
|
|
||||||
## For loops
|
## `for` loops
|
||||||
|
|
||||||
`for` loops are the fundamental building block of iteration that both the apply and map families use under the hood.
|
`for` loops are the fundamental building block of iteration that both the apply and map families use under the hood.
|
||||||
`for` loops are powerful and general tools that are important to learn as you become a more experienced R programmer.
|
`for` loops are powerful and general tools that are important to learn as you become a more experienced R programmer.
|
||||||
|
@ -443,7 +443,7 @@ for (element in vector) {
|
||||||
```
|
```
|
||||||
|
|
||||||
The most straightforward use of `for` loops is to achieve the same effect as `walk()`: call some function with a side-effect on each element of a list.
|
The most straightforward use of `for` loops is to achieve the same effect as `walk()`: call some function with a side-effect on each element of a list.
|
||||||
For example, in @sec-save-database instead of using walk:
|
For example, in @sec-save-database instead of using `walk()`:
|
||||||
|
|
||||||
```{r}
|
```{r}
|
||||||
#| eval: false
|
#| eval: false
|
||||||
|
|
Loading…
Reference in New Issue