---
title: |
    | STAT 408 - Data Viz Principles
date: "February 15, 2018"
output: html_document
---


```{r setup, include=FALSE}
library(knitr)
library(formatR)
library(XML)
library(dplyr)
library(ggplot2)
knitr::opts_chunk$set(echo = TRUE)
knitr::knit_hooks$set(mysize = function(before, options, envir) {
  if (before) 
    return(options$size)
})
```

## Exercise: Telling Stories with Data

- What does statistics mean to you?
- How about data science?
- data visualization?



## Exercise: Hans Rosling Discussion
[http://www.youtube.com/embed/jbkSRLYSojo?rel=0](http://www.youtube.com/embed/jbkSRLYSojo?rel=0)

- What did you learn from this movie?
- How did Hans Rosling use data visualization to tell a story?
- What principles from the visualization would you like to be able to do?



## Exercise: Visualizing Patterns Over Time

- What are we looking for with data over time?


## Capital Bikeshare Data

```{r}
url <- 'http://www.math.montana.edu/ahoegh/teaching/stat408/datasets/Bike.csv'
bike.data <- read.csv(url,stringsAsFactors = F)
head(bike.data)
bike.data$year <- substr(bike.data$datetime,1,4)
bike.data$month <- substr(bike.data$datetime,6,7)
monthly.counts <- summarize(group_by(bike.data,month), sum(count))
colnames(monthly.counts)[2] <- 'Num.Bikes'
head(monthly.counts)
```



## Exercise: Patterns over Time

Consider the number of bike rentals per hour per season
- Is this an example of continuous or discrete time?
- Make a figure to display your findings



## Exercise: Visualizing Proportions

- What to look for in proportions?


## Exercise: Visualizing Relationships

- When considering relationships between variables, what are we looking for?