Publications by Ronan Harrington
Reshaping data frames using pivot functions from {tidyr} and tally from {dplyr}
Introduction In this post, the San Francisco Rentals data set is used to demonstrate data reshaping in R. This involves changing the number of columns and rows in a data frame to fit a given use case. A data frame is made more tall or narrow by decreasing the number of columns, and wider by increasing the number of columns. The three reshaping me...
1676 sym R (9213 sym/6 pcs) 4 img
How to write a function in R and apply it to a data frame using map functions from {purr}
Introduction In this post, the European Flights data set is used to illustrate defining a function in R and applying it to a data frame using map functions from {purr}. The full source for this blog post is available on GitHub. Setup Loading the R libraries and data set. # Loading libraries library(tidytuesdayR) library(tidyverse) library(tidytex...
1982 sym R (5043 sym/4 pcs) 2 img
Adding continent and country names with {countrycode}, and subsetting a data frame using sample()
Introduction In this post, the Technology Adoption data set is used to illustrate data exploration R and adding information using the {countrycode} package. During data exploration, the tt$technology data set is filtered to select for the “Energy” category, and the distinct values for “variable” and “label” are printed. A subset is th...
1696 sym R (9771 sym/5 pcs) 4 img
Bechdel Test
Setup Loading the R libraries and data set. # Loading libraries library(gganimate) library(tidytuesdayR) library(tidyverse) library(tidytext) library(forcats) # Loading the Bechdel Test data set tt <- tt_load("2021-03-09") Downloading file 1 of 2: `raw_bechdel.csv` Downloading file 2 of 2: `movies.csv` Illustrating the change in Bechde...
1211 sym R (3102 sym/4 pcs) 2 img
Welcome
Welcome to my TidyTuesday blog. This site features graphs and analysis of various data sets from the R for Data Science (R4DS) #TidyTuesday project. Related To leave a comment for the author, please follow the link and comment on their blog: Ronan's #TidyTuesday blog. R-bloggers.com offers daily e-mail updates about R news and tu...
570 sym
Video Games and Sliced
Setup Loading the R libraries and data set. # Loading libraries library(tidyverse) # Reading in the raw data from GitHub (I would use "tt_load", but I hit an API # rate limt) games <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-03-16/games.csv') Plotting Peak vs. Average number of players...
2461 sym R (3233 sym/4 pcs) 4 img
UN Votes: Plotting votes on United Nations resolutions
Setup and data preparation Loading the R libraries and data set. # Loading libraries library(forcats) library(tidytext) library(tidyverse) library(tidytuesdayR) # Loading data tt <- tt_load("2021-03-23") Downloading file 1 of 3: `unvotes.csv` Downloading file 2 of 3: `roll_calls.csv` Downloading file 3 of 3: `issues.csv` Wrangling ...
2377 sym R (6078 sym/6 pcs) 8 img
Plotting foundations according to shade
Setup and data preparation Loading the R libraries and data set. # Loading libraries library(tidyverse) library(tidytuesdayR) library(viridis) library(tidytext) library(forcats) library(ggridges) # Loading data set tt <- tt_load("2021-03-30") Downloading file 1 of 5: `ulta.csv` Downloading file 2 of 5: `sephora.csv` Downloading fil...
1665 sym R (4510 sym/5 pcs) 6 img
Plotting deforestation and its causes
Setup Loading the R libraries and data set. # Loading libraries library(tidyverse) library(tidytuesdayR) # Loading data tt <- tt_load("2021-04-06") Downloading file 1 of 5: `forest.csv` Downloading file 2 of 5: `forest_area.csv` Downloading file 3 of 5: `brazil_loss.csv` Downloading file 4 of 5: `soybean_use.csv` Downloadin...
1594 sym R (4862 sym/4 pcs) 4 img
Post offices in the USA from 1772 to 2000
Setup Loading the R libraries, data set, and a shapefile for the USA. # Loading libraries library(tidyverse) library(tidytuesdayR) library(gganimate) library(sf) # Loading data set tt <- tt_load("2021-04-13") Downloading file 1 of 1: `post_offices.csv` # Loading USA shapefile usa_shapefile <- read_sf("~/TidyTuesday/data/States_shapefile-s...
1092 sym R (1781 sym/4 pcs) 4 img