Things we learned in September 2019

A monthly recap covering {packup}, prefix notation for infix operators, {esquisse}, tidyr 1.0’s pivot functions, and Mara Averick’s hoist() animations.
R
Published

October 1, 2019

September 2019 has been a great month for us. We officially launched our website and started building our brand with @rfindingyourway.

Let’s recap some of the things we’ve learned this month and seen in the #rstats community.

Tidy up loading pkgs with {packup}

One of our daily tweets reminded folks to load packages at the top of scripts. We were delighted to discover @MilesMcBain’s {packup} package which contains an RStudio add-in to automate moving library("pkg") to the top of RMarkdown documents!

Prefix notation with backtick operators

We discovered that the dplyr::add_tally() function includes a really nice example of prefixed infix operators — so nice that we tweeted about it and wrote a blogpost about it.

ggplot2 GUI with {esquisse}

On our training courses we’re often asked about a GUI for building {ggplot2} charts. Before September our answer was always “we don’t know about one”.

Now we recommend the excellent {esquisse} package, see dreamrs.github.io/esquisse/ for more details.

Using the GUI comes with a disclaimer. Hadley Wickham has a great slide deck on why data science can’t be done in a GUI, which is why we’d always teach the fundamentals of {ggplot2} so you can iterate away from the boilerplate dataviz that {esquisse} allows you to create.

spread()’s dead, baby, spread()’s dead

gather() and spread() have been retired as the workhorses of {tidyr} with the release of v1.0 in favour of the more expressive and versatile pivot_longer() and pivot_wider(), respectively.

We ended up writing a short dedicated blogpost on this topic, which includes a summary of our Twitter poll on the subject with 196 responses.

hoist() animations from @dataandme

The release of {tidyr} v1.0 brings many new features to the tidyverse for working with nested tibbles — which is affectionately called rectangling. These rectangling functions are fairly complex, and often the simplest way to explain them is with a GIF.

We particularly enjoyed the hoist() animated GIF from Mara Averick, and hope to see more function demos in the near future!