class: center, middle, inverse, title-slide # DSBA 5122: Visual Analytics ## Class 4: Time and Space ### Ryan Wesslen ### September 16, 2019 --- # In class assignment: 30 minutes .pull-left[ ## Create new RStudio Cloud Project 1. Pair up with person next to you. 2. Create a new RStudio.Cloud Project. Share that workspace with your partner. 3. Install `devtools` and `socviz` by running: ```r install.packages('devtools') # install devtools devtools::install_github("kjhealy/socviz") ``` 4. Create a new .Rmd project. Load `socviz` and `tidyverse`. Look at the data frame `organdata`. ] .pull-right[ ## Bootstrapped Mean C.I.'s 1. Read the first examples of this page: [`stat_summary`](https://ggplot2.tidyverse.org/reference/stat_summary.html). 2. (Optional) Read up on why bootstrapping works [StackExchange](https://stats.stackexchange.com/questions/26088/explaining-to-laypeople-why-bootstrapping-works) 3. Change "05-tables-and-labels-14" plot in [`05_tables_and_labels.Rmd`](https://rstudio.cloud/spaces/22733/project/160035) to a bootstrapped mean 95% confidence interval. Modify parameters by looking at [`?geom_pointrange`](https://ggplot2.tidyverse.org/reference/geom_linerange.html). 4. (Bonus): Google "tidy bootstrapping". Is there a better (tidy) way to do it? ] --- class: center, middle, inverse # Time: Wilke Chapters 13-14 <blockquote class="twitter-tweet tw-align-center" width="50%"><p lang="en" dir="ltr">In this week's <a href="https://twitter.com/hashtag/tidytuesday?src=hash&ref_src=twsrc%5Etfw">#tidytuesday</a> screencast, I analyze and predict trends in US dairy consumption over time<br><br>In the process I learn to do tidy forecasting with the sweep and timetk packages from <a href="https://twitter.com/bizScienc?ref_src=twsrc%5Etfw">@bizscienc</a> 📈 📉<a href="https://t.co/RyS50Ss6Vx">https://t.co/RyS50Ss6Vx</a> <a href="https://twitter.com/hashtag/rstats?src=hash&ref_src=twsrc%5Etfw">#rstats</a> <a href="https://t.co/Qlf5nfJx1u">pic.twitter.com/Qlf5nfJx1u</a></p>— David Robinson (@drob) <a href="https://twitter.com/drob/status/1090336749778337792?ref_src=twsrc%5Etfw">January 29, 2019</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> --- class: center, middle # Visualizing one temporal variable <img src="../images/slides/04-class/timeseries.png" width="700px" style="display: block; margin: auto;" /> --- class: center, middle # Visualizing one temporal variable <img src="../images/slides/04-class/timeseries2.png" width="700px" style="display: block; margin: auto;" /> --- class: center, middle # Visualizing one temporal variable <img src="../images/slides/04-class/timeseries3.png" width="700px" style="display: block; margin: auto;" /> --- class: center, middle # Visualizing one temporal variable <img src="../images/slides/04-class/timeseries4.png" width="700px" style="display: block; margin: auto;" /> --- class: center, middle # Visualizing Indexes <img src="../images/slides/04-class/index1.png" width="700px" style="display: block; margin: auto;" /> --- class: center, middle # Visualizing Indexes: Detrending <img src="../images/slides/04-class/index2.png" width="700px" style="display: block; margin: auto;" /> --- class: center, middle # Visualizing two temporal variables <img src="../images/slides/04-class/timeseries5.png" width="700px" style="display: block; margin: auto;" /> --- class: center, middle # Visualizing two temporal variables <img src="../images/slides/04-class/timeseries6.png" width="700px" style="display: block; margin: auto;" /> --- # Keeling Curve: What do you notice? <img src="../images/slides/04-class/keeling-curve-1.png" width="700px" style="display: block; margin: auto;" /> --- # Trend + Seasonal + Noise <img src="../images/slides/04-class/keeling-curve-decomposition-1.png" width="600px" style="display: block; margin: auto;" /> --- # Ratios to log <img src="../images/slides/04-class/ratio.png" width="700px" style="display: block; margin: auto;" /> --- # Ratios to log <img src="../images/slides/04-class/log.png" width="700px" style="display: block; margin: auto;" /> --- class: middle, inverse, center # Spatial/Maps: Wilke Chap. 15 and Healy Chap. 7 <blockquote class="twitter-tweet tw-align-center" width="50%"><p lang="en" dir="ltr">Putting Hawaii and Alaska into their place. <a href="https://twitter.com/hashtag/rstats?src=hash&ref_src=twsrc%5Etfw">#rstats</a> <a href="https://twitter.com/hashtag/dataviz?src=hash&ref_src=twsrc%5Etfw">#dataviz</a> <a href="https://twitter.com/hashtag/gganimate?src=hash&ref_src=twsrc%5Etfw">#gganimate</a> <a href="https://t.co/JOMWlVv3A9">pic.twitter.com/JOMWlVv3A9</a></p>— Claus Wilke (@ClausWilke) <a href="https://twitter.com/ClausWilke/status/1026190740370731009?ref_src=twsrc%5Etfw">August 5, 2018</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> --- # Scale <img src="../images/slides/04-class/scale.png" width="600px" style="display: block; margin: auto;" /> --- # Scale <img src="../images/slides/04-class/scale-2.png" width="600px" style="display: block; margin: auto;" /> --- # Projections <img src="../images/slides/04-class/projection.png" width="550px" style="display: block; margin: auto;" /> --- # Projections <img src="../images/slides/04-class/projection2.png" width="600px" style="display: block; margin: auto;" /> --- # Projections <img src="../images/slides/04-class/projection3.png" width="700px" style="display: block; margin: auto;" /> --- # Map encoding <img src="../images/slides/04-class/encode.png" width="700px" style="display: block; margin: auto;" /> --- # UVA's Racial Dot Map <img src="../images/slides/04-class/dotmap.png" width="450px" style="display: block; margin: auto;" /> <https://demographics.virginia.edu/DotMap/index.html> --- # Chloropleths <img src="../images/slides/04-class/chloropleth.png" width="600px" style="display: block; margin: auto;" /> --- # Chloropleths <img src="../images/slides/04-class/chloropleth2.png" width="600px" style="display: block; margin: auto;" /> --- # Chloropleths <img src="../images/slides/04-class/chloropleth3.png" width="600px" style="display: block; margin: auto;" /> --- # Chloropleths <img src="../images/slides/04-class/chloropleth4.png" width="600px" style="display: block; margin: auto;" /> --- # Cartograms <img src="../images/slides/04-class/chloropleth5.png" width="600px" style="display: block; margin: auto;" /> --- # Cartograms <img src="../images/slides/04-class/chloropleth6.png" width="600px" style="display: block; margin: auto;" /> --- # Small multiples: Time & Space <img src="../images/slides/04-class/chloropleth7.png" width="600px" style="display: block; margin: auto;" />