What I'm Thinking

Last Words from Death Row
25 November 2017

A Kaggle data source here provides the public with information on Texas death row inmates from 1982 to 2017. It includes name, age, race, county, date, and last words from each person. We will analyze this using R to conduct text analysis. Let’s load up tidytext to get started and then pull in the text data file. # Set up tidytext require(tidytext) # Set working directory setwd("~/Desktop/R/TX_Executions/text/") # Load dataset offenders <- read.table("Last_Statement.txt") # offenders <- readLines(file.choose()) head(offenders) Next, we’re going to load additional libraries and convert the text document into a text corpus. ... Read More
We will answer this question using R. First, load the dataset. It contains state names, census regions, census divisions, 2013 populations and the number of registered gun owners (also in 2013). This data comes to us from CBS News. # Set working directory setwd("~/Desktop") # Load dataset library(readxl) Firearms_Data_KAD <- read_excel("~/Desktop/R/Per Capita Firearms Registered/Firearms_Data_KAD.xlsx") head(Firearms_Data_KAD) ## # A tibble: 6 x 6 ## StateName StateLower CensusRegion Division `2013Pop` `2013Registered… ## <chr> <chr> <chr> <chr> <dbl> <dbl> ## 1 Wyoming wyoming West Mountain 582658 114052 ## 2 District … district o… South South At… 646449 42897 ## 3 Arkansas arkansas South West Sou… 2959373 123130 ## 4 New Mexico new mexico West Mountain 2085287 84471 ## 5 Virginia virginia South South At… 8260405 248939 ## 6 Idaho idaho West Mountain 1612136 39019 Next, let’s load all of the packages we’ll use for data transformations and visualizations. ... Read More
This analysis uses 3 datasets. The first has information from the NFL draft, the second has information on NFL team statistics, and the third includes information from the Deflategate scandal involving the New England Patriots. Let’s load the needed data and R packages. # Install needed packages library(ggplot2) library(vcd) library(stats) library(car) # Load data that will be used for this analysis # Rename Football Stats dataset (with drank rankings) footballstats.data <- read.csv("Dataset1FootballStats.csv") # Rename Team Football Stats dataset teamfootballstats.data <- read.csv("Dataset2TeamFootballStats.csv") # Rename Deflategate dataset football.data <- read.csv("Dataset3FootballDeflatagate.csv") Part 1: Draft Rankings First performed an exploratory data analysis to understand the NFL draft data after adding the team records to this dataset, looking specifically at the relationship between team record and draft order. ... Read More
For a project in my data visualization class, I created an infographic summarizing some information on the Grapefruit League. Every spring, American baseball teams move to Florida (Grapefruit League) or Arizona (Cactus League) to train. There are multiple teams in the Orlando area every year, which is what inspired me to examine this particular topic. A PDF of the report and final infographic can be found here. The following will walk through how the base R images were created. ... Read More