TidyX 89: Constructing Tables for Research Publication in R

This week, Ellis Hughes and I delve into our mailbag to answer a question posed to us inquiring how we would go about creating tables for research publication in R. Most of the time it seems that people will get their model outputs and transpose them into Excel to build a table. But, in R you can go directly from the model output straight to a nice table that meets that journal’s requirements.

In this episode, we build a regression model and use {broom} to tidy the model outputs into a clean data frame. When then take that output and walk through different ways of using {gt} to customize your table for publication. We wrap up by covering how to build a plot of the interquartile range and annotate that plot to provide more context using {ggplot2}.

To watch our screen cast, CLICK HERE.

To access our code, CLICK HERE.

Tidymodels model fitting template

We recently completed a 10 episode series on the Tidy Explained screen cast about building models within the {tidymodels} framework of R.

To tie it the series together I put together an RMarkdown file that walks through the model fitting process in {tidymodels}. The RMarkdown template provides a step-by-step process that one can take when building {tidymodels} on their own data.

If you knit the RMarkdown template, you will get an html report that covers the basics of:

  • Splitting data into training, testing, and cross validation sets
  • Specifying models
  • Pre-processing with model recipes
  • Setting up workflows and workflowsets
  • Fitting models and parameter tuning
  • Evaluating model outputs
  • Making predictions on test data
  • Saving the model workflow for future model deployment
  • Loading the saved model workflow and deploying it on a new data set

To access the template, go to my GITHUB page.

Below are the 10 {tidymodels} episodes we did on Tidy Explained if you’d like to see the processes performed in real time:

TidyX 77: Intro to tidymodels
TidyX 78: Splits & Recipes
TidyX 79: Cross-Validation & Model Metrics
TidyX 80: Tuning Decision Trees
TidyX 81: Logistic Regression
TidyX 82: Random Forest Classifier
TidyX 83: Naive Bayes Classifier
TidyX 84: Workflowsets
TidyX 85: Workflowsets & Parameter Tuning
TIdyX 86: Tidymodels interview with Julia Silge

TidyX 88: Advent of Code Day 7 – Loops & Lookups

Continuing from last week, Ellis Hughes and I step through a solution for Advent of Code Day 7. This week’s code puzzle has us trying to solve a method for finding a minimum value in a string of numbers created by some simple mathematical operations.

The task requires us to use some for() loops and build a lookup table for identifying values.

To watch our screen cast, CLICK HERE.

To access our code, CLICK HERE.

TidyX 87: Advent of Code – Laternfish

This week, Ellis Hughes and I decide to try our hand at some of the coding challenges put on by the annual Advent of Code event.

For those that don’t know, Advent of Code is a fun, holiday event, where the founder, Eric Wastl, creates 25 straight days of puzzles and brain teasers to be solved via code. The event is coding language agnostic (some use R, some use Python, some use other languages) and is a lot of fun. If you search on Twitter you will find a large number of people sharing solutions and ideas.

This week, we go over code to solve the Day 6 puzzle about laternfish.

To watch our screen cast, CLICK HERE.

To access our code, CLICK HERE.

TidyX 86: Tidymodels Interview with Julia Silge

Ellis Hughes and I have just completed 9 straight episodes on building a machine learning framework with {tidymodels}. What better way to wrap up this series than with our tenth episode being an interview with none other than, Julia Silge!

Julia is one of the main developers of the {tidymodels} package and continues to be a great ambassador of all things R, educating people along the way with her weekly screen casts.

In this episode we:

  1. Discuss Julia’s background and how she got into working for R studio.
  2. We walk through one of her blog posts on using racing methods to tune XGBoost models.
  3. As we walk through the blog post we discuss some of the functionality of {tidymodels} and learn a bit about Julia’s approach to working on data science projects.
  4. Finally, we wrap up with Julia offering some pearls of wisdom to those looking to get into the field.

To watch our interview with Julia Silge, CLICK HERE.