R

Across (dplyr 1.0.0): applying dplyr functions simultaneously across multiple columns

With the introduction of dplyr 1.0.0, there are a few new features: the biggest of which is across() which supersedes the scoped versions of dplyr functions.

Rebecca Barter

Select helpers: selecting columns to apply the function to Using in-line functions with across A mutate example A select example I often find that I want to use a dplyr function on multiple columns at once. For instance, perhaps I want to scale all of the numeric variables at once using a mutate function, or I want to provide the same summary for three of my variables.

Tidymodels: tidy machine learning in R

The tidyverse's take on machine learning is finally here. Tidymodels forms the basis of tidy machine learning, and this post provides a whirlwind tour to get you started.

Rebecca Barter

What is tidymodels Getting set up Split into train/test Define a recipe Specify the model Put it all together in a workflow Tune the parameters Finalize the workflow Evaluate the model on the test set Fitting and using your final model Variable importance There’s a new modeling pipeline in town: tidymodels. Over the past few years, tidymodels has been gradually emerging as the tidyverse’s machine learning toolkit.

5 useful R tips from rstudio::conf(2020) - tidy eval, piping, conflicts, bar charts and colors

Last week I had the pleasure of attending rstudio::conf(2020) in San Francisco. Throughout the course of the week I met many wonderful people and learnt many things. This post covers some of the little tips and tricks that I learnt throughout the conference.

Rebecca Barter

Tip 1: Tidy evaluation Tip 2: Pipe into later arguments of a function using . Tip 3: Function conflicts workaround (no more dplyr::select()) Tip 4: geom_col(): you’ll never have to specify “stat = identity” for your bar plots ever again! Tip 5: Using show_col() for viewing colour palettes This was my second year attending rstudio::conf() as a diversity scholar (and my first time as a speaker), and I was yet again blown away by the friendliness of the community and the quality of the talks.