diff --git a/iteration.Rmd b/iteration.Rmd index a8e2a3f..7561624 100644 --- a/iteration.Rmd +++ b/iteration.Rmd @@ -438,7 +438,7 @@ Hopefully, you'd notice that there's a lot of duplication, and extract it out in f <- function(x, i) abs(x - mean(x)) ^ i ``` -You've reduced the chance of bugs (because you now have 1/3 less code), and made it easy to generalise to new situations. +You've reduced the chance of bugs (because you now have 1/3 of the original code), and made it easy to generalise to new situations. We can do exactly the same thing with `col_mean()`, `col_median()` and `col_sd()` by adding an argument that supplies the function to apply to each column: