Update iteration.Rmd (#232)

This commit is contained in:
Rademeyer Vermaak 2016-08-05 15:52:46 +02:00 committed by Hadley Wickham
parent 238880b233
commit 8c07dc278a
1 changed files with 1 additions and 1 deletions

View File

@ -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: