Author: Martin Frigaard
How to calculate a rolling average in R
Rolling or moving averages are a way to reduce noise and smooth time series data. During the Covid-19 pandemic, rolling averages have been used by researchers and journalists around the […]
Update: How to geocode a CSV of addresses in R
This post is an update from the previous post, “How to geocode a CSV of addresses in R”. We will be using the ggmap package again, and be sure to investigate the usage […]
A roundup of coronavirus dashboards, datasets and resources
Access and availability of data on the novel coronavirus and the disease it causes, Covid-19, are essential for understanding how the virus spreads, who is most likely to get it, […]
Diagnosing the accuracy of your linear regression in R
In this post we’ll cover the assumptions of a linear regression model. There are a ton of books, blog posts, and lectures covering these topics in greater depth (and we’ll […]
How to explore correlations in R
This post will cover how to measure the relationship between two numeric variables with the corrr package. We will look at how to assess a variable’s distribution using skewness, kurtosis, […]
How to download YouTube data in R using “tuber” and “purrr”
Accessing YouTube’s metadata such as views, likes, dislikes and comments is simple in R thanks to thetuber package by Gaurav Sood. Sood wrote an excellent, easy-to-use package for accessing the […]
How to build a website with Blogdown in R
Want to build a website right in RStudio? blogdown is an R package that allows you to create websites from R markdown files using Hugo, an open-source static site generator […]
How to access APIs in R
APIs, or application program interfaces, are a way for people to access data in a plain text format using multiple programming languages. Many websites, organizations and services offer APIs for […]
Pivoting data from columns to rows (and back!) in the tidyverse
TLDR: This tutorial was prompted by the recent changes to the tidyr package (see the tweet from Hadley Wickham below). Two functions for reshaping columns and rows (gather() and spread()) […]
From deep learning to clean_names(), resources from Data Journalism in R
Books to check out Deep Learning in R This text is from by Francois Chollet and J. J. Allaire. The authors cover these topics in-depth with plenty of code examples. Analyzing Baseball Data […]
Scraping HTML tables and downloading files with R
The Department of Criminal Justice in Texas keeps records of every inmate they execute. This tutorial will show you how to scrape that data, which lives in a table on […]
How to install R on a Jupyter notebook
This post walks through how to install R on a Jupyter notebook, load in data and build a visualization. Start by installing python using homebrew. Install python Open Terminal and enter the […]
How to get Twitter data with rtweet in R
There’s a new process for getting data from Twitter with rtweet, so I put this document together as a guide for users looking for help in setting up the API, […]
How to build an animated map of tweets about the NBA finals in R
After beating the Cleveland Cavaliers in four games, the Golden State Warriors have won the 2018 NBA finals. We decided to build an animated map of Twitter mentions of #DubNation […]
Getting started with stringr for textual analysis in R
Manipulating characters – a.k.a. non-numerical data – is an essential skill for anyone looking to visualize or analyze text data. This tutorial will go over a few of the base […]