Update iteration.Rmd (#232)
This commit is contained in:
parent
238880b233
commit
8c07dc278a
|
@ -435,7 +435,7 @@ col_sd <- function(df) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Uh oh! You've copied-and-pasted this code twice, so it's time to think about how to generalise it. Notice that most of code is for-loop boilerplate and it's hard to see the one thing (`mean()`, `median()`, `sd()`) that is different between the functions.
|
Uh oh! You've copied-and-pasted this code twice, so it's time to think about how to generalise it. Notice that most of this code is for-loop boilerplate and it's hard to see the one thing (`mean()`, `median()`, `sd()`) that is different between the functions.
|
||||||
|
|
||||||
What would you do if you saw a set of functions like this:
|
What would you do if you saw a set of functions like this:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue