Publications by Kitada Smalley

More ggplot2 Tips and Tricks

05.10.2020

Switching between discrete and continuous representations library(tidyverse) data("diamonds") ggplot(diamonds) + geom_point(aes(carat, price)) # hard to see anything going on ggplot(diamonds) + geom_point(aes(carat, price, colour = depth)) # cut depth into five equisized groups, instead ggplot(diamonds) + geom_point(aes(carat, price, ...

304 sym R (1539 sym/14 pcs) 12 img

DataViz Class 3 Example

22.09.2020

R Markdown This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com. When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within t...

591 sym R (268 sym/2 pcs) 1 img

Recreating Lakers Shot Plot

21.09.2020

Los Angeles Lakers Shooting Heatmap In this exercise we will recreate a graphic that describes positions on the basketball court the average points scored from that position and the frequency at which shot are taken from this position. The Data These data represent the LA Lakers 2009/2010 season and come from http://www.basketballgeek.com. We ar...

830 sym R (3131 sym/25 pcs) 9 img

MATH 138: SLR

17.09.2020

Example #1: Hikers The following data represents the body weight (lbs) and backpack weight (lbs) for a group of hikers: ## BACKPACKING body<-c(120, 187, 109, 103, 131, 165, 159, 116) backpack<-c(26, 30, 26, 24, 29, 35, 31, 28) hikers<-data.frame(body, backpack) Create a scatterplot library(tidyverse) ggplot(hikers, aes(body, backpack))+ geom...

1959 sym R (3446 sym/31 pcs) 5 img

DataViz: Choosing an appropriate visualization tool

14.09.2020

I: Basic Graphics We will be doing simplified reproductions of figures found in Storytelling with Data. When we learn more about ggplot we can personalize and polish our plots more. 1) Heatmapped Table To create a heatmapped table you might want to use the following packages: ztable or tidyverse. I had a lot of difficult with installing ztable. ...

1573 sym R (7792 sym/40 pcs) 14 img

Language Explorer Demo Examples

08.10.2020

Example #1: Which languages have the greatest number of linguistically isolated households? STEP 1: Import Pre-Cleaned Data hhl<-read.csv("https://raw.githubusercontent.com/kitadasmalley/languageExplorer/main/data/yearHHL_Ex.csv", header=TRUE) ## Warning in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : ## embedded nul(s) ...

736 sym R (3565 sym/20 pcs) 4 img

MATH 138: Scatterplots, Correlation, and SLR

09.10.2020

Example #1: Hikers The following data represents the body weight (lbs) and backpack weight (lbs) for a group of hikers: ## BACKPACKING body<-c(120, 187, 109, 103, 131, 165, 159, 116) backpack<-c(26, 30, 26, 24, 29, 35, 31, 28) hikers<-data.frame(body, backpack) Create a scatterplot library(tidyverse) ggplot(hikers, aes(body, backpack))+ geom...

2122 sym R (3446 sym/31 pcs) 5 img

Regression Examples

13.10.2020

Multiple Linear Regression Categorical Explanatory Variables and Interactions Example 1: Shipping Books When you buy a book off Amazon, you get a quote for how much it costs to ship. This is based on the weight of the book. If you didn’t know the weight of the book, what other characteristics of it could you measure to help predict the weight...

2030 sym R (8447 sym/37 pcs) 12 img

DataViz: Polishing Demo

26.10.2020

Adapted from a lab written by Prof Charlotte Wickham The data These data come from the hflights package, but some summarization is done for you. library(tidyverse) iah <- read_csv("http://vis.cwick.co.nz/data/iah-summary.csv") Start with this heatmap: The heatmap represents the proportion of flights that have a departure delay of more that 15 m...

831 sym R (8067 sym/31 pcs) 14 img

DataViz: Scales Lab (SOLUTIONS)

25.10.2020

Adapted from a lab written by Prof Charlotte Wickham LAB SOLUTIONS: Exploring flight delays To experiment with some features of scales we are going to work with a heatmap of the proportion of flights that have a departure delay of more that 15 minutes (prop_over_15) at the George Bush Intercontinental Airport (IAH) by day of the week (DayOfWeek...

3906 sym R (2604 sym/24 pcs) 10 img