Pure, predictable, pipeable: creating fluent interfaces with R w/ Hadley Wickham


For the first time ever we will meet on a Friday so as many people as possible can attend Hadley's talk!

A big thank you to Twitter for hosting us this month and for providing pizza and beer.

About the talk:

A fluent interface lets you easily express yourself in code. Over time a fluent interface retreats to your subconscious. You don't need to bring it to mind; the code just flows out of your fingers. I strive for this fluency in all the packages I write, and while I don't always succeed, I think I've learned some valuable lessons along the way.

In this talk, I'll discuss three guidelines that make it easier to develop fluent interfaces:

• Pure functions. A pure function only interacts with the world through its inputs and outputs; it has no side-effects. Pure functions make great building blocks because they're are easy to reason about and can be easily composed.

• Predictable interfaces. It's easier to learn a function if it's consistent, because you can learn the behaviour of a whole group of functions at once. I'll highlight the benefits of predictability with some of my favourite R "WAT"s (including `c()`, `sapply()` and `sample()`).

• Pipes. Pure predictable functions are nice in isolation but are most powerful in combination. The pipe, `%>%`, is particularly in important when combining many functions because it turns function composition on its head so you can read it from left-to-right. I'll show you how this has helped me build dplyr, rvest, ggvis, lowliner, stringr and more.

This talk will help you make best use of my recent packages, and teach you how to apply the same principles to make your own code easier to use.

About Hadley:

Hadley (http://had.co.nz/) is Chief Scientist at RStudio (http://www.rstudio.com/) and a member of the R Foundation (https://www.r-project.org/foundation/). He builds tools (computational and cognitive) to support data science. His work includes R packages for data analysis (ggvis (http://ggvis.rstudio.com/), dplyr (https://github.com/hadley/dplyr), tidyr (https://cran.r-project.org/web/packages/tidyr/vignettes/tidy-data.html)), data ingest (readr (https://github.com/hadley/readr), readxl (https://github.com/hadley/readxl), haven (https://github.com/hadley/haven)), and principled software development (roxygen2 (https://cran.r-project.org/web/packages/roxygen2/vignettes/roxygen2.html), testthat (https://github.com/hadley/testthat), devtools (https://www.rstudio.com/products/rpackages/devtools/)). He is also a writer, educator, and frequent speaker promoting more accessible, more effective and more fun data analysis.

Notes about this meetup:

Doors open with pizza (http://bit.ly/pizzapoll) and beer 6, announcements and Hadley's talk begin at 7 and then we'll go to a local bar after.

For security purposes you MUST provide your first and last names and bring photo ID to the meetup. Twitter will be checking names at the door and anyone who does not provide their full name cannot be admitted.

Note: Press is not admitted into these events; please e-mail [masked] if you have any questions. Twitter reserves the right to refuse entry to this event. Twitter also reserves the right to remove individuals from Twitter's premises for disruptive or disorderly behavior, or for any other reason in Twitter's sole discretion. Please be sure to bring a valid ID, as this event is 21+.


Tickets are still available to Strata (https://tracking.cirrusinsight.com/d277e80c-e5f3-4ec8-91e8-9e81c918cd64/oreil-ly-shwny15ug) at a 20% discount using code UGNYHACKR20 (https://tracking.cirrusinsight.com/d277e80c-e5f3-4ec8-91e8-9e81c918cd64/oreil-ly-1kc2scb).