diff --git a/pipes.Rmd b/pipes.Rmd index 144a94f..6eb3367 100644 --- a/pipes.Rmd +++ b/pipes.Rmd @@ -56,7 +56,7 @@ The main downside of this form is that it forces you to name each intermediate e Whenever I write code like this, I invariably use the wrong number on one line and then spend 10 minutes scratching my head and trying to figure out what went wrong with my code. -You may also worry that this form creates many copies of your data and takes up a lot of memory. Suprisingly, that's not the case. First, note that proactively worrying about memory is not a useful way to spend your time: worry about it when it becomes a problem (i.e. you run out of memory), not before. Second, R isn't stupid, and it will share columns across data frames, where possible. Let's take a look at an actual data manipulation pipeline where we add a new column to `ggplot2::diamonds`: +You may also worry that this form creates many copies of your data and takes up a lot of memory. Surprisingly, that's not the case. First, note that proactively worrying about memory is not a useful way to spend your time: worry about it when it becomes a problem (i.e. you run out of memory), not before. Second, R isn't stupid, and it will share columns across data frames, where possible. Let's take a look at an actual data manipulation pipeline where we add a new column to `ggplot2::diamonds`: ```{r} diamonds <- ggplot2::diamonds @@ -208,7 +208,7 @@ The pipe is a powerful tool, but it's not the only tool at your disposal, and it ## Other tools from magrittr -All packages in the tidyverse automatically make `%>%` alivaiable for you, so you don't normally load magrittr explicitly. However, there are some other useful tools inside magrittr that you might want to try out: +All packages in the tidyverse automatically make `%>%` available for you, so you don't normally load magrittr explicitly. However, there are some other useful tools inside magrittr that you might want to try out: * When working with more complex pipes, it's sometimes useful to call a function for its side-effects. Maybe you want to print out the current