Project 1 due date move to one 1 week later to accommodate a change in schedule in the library visit / historical data visualizations unit.
HW 1 is posted, you will be working on it in lab tomorrow, due on Tue, Jan 30 at 5 pm. To submit, simply push your work to your GitHub repository.
From RQ reflections
More on the following upcoming in the class:
Scales (e.g., 400000 to 400K), themes and theme features (e.g., moving plot title), faceting
Plot sizing for including in a report, slide deck, etc.
Which plots to use for numerical vs. categorical variables
Strategies for figuring out which function to use
Why do we need to set a seed for geom_jitter()?
How to choose between fill and color?
Review more examples of “bad graphs” with less obvious reasons as to why they are bad – bring your (good and bad) plots to school!
Suggestion: Time for random plotting/coding questions during/end of class
Today’s focus
Dive into data wrangling and tidying (for better/easier visualization) within a single data frame
Peek at one more layer: statistics
So far we’ve reviewed data, aesthetics, geometries
We’ll soon review facets and themes
In your HW you’ll revisit coordinates
Setup
# load packageslibrary(tidyverse)library(countdown)library(scales)library(ggthemes)library(glue)# set theme for ggplot2ggplot2::theme_set(ggplot2::theme_minimal(base_size =14))# set width of code outputoptions(width =65)# set figure parameters for knitrknitr::opts_chunk$set(fig.width =7, # 7" widthfig.asp =0.618, # the golden ratiofig.retina =3, # dpi multiplier for displaying HTML output on retinafig.align ="center", # center align figuresdpi =300# higher dpi, sharper image)
Transforming and reshaping a single data frame
Scenario 1
We…
have a single data frame
want to slice it, and dice it, and juice it, and process it, so we can plot it
Data: Hotel bookings
Data from two hotels: one resort and one city hotel