name: 1 class: center middle main-title section-title-4 # Interactive webmapping and visualization with R .class-info[ **Session 19** .light[HES597: Introduction to Spatial Data in R<br> Boise State University Human-Environment Systems<br> Fall 2021] ] --- # 3 Categories of data visualization .pull-left[ - Static - Interactive - Dynamic ] .pull-right[ ![dynamic](img/10/example_3a.gif) ] --- name: motivations class: center middle main-title section-title-4 # Motivations --- # Dealing with complex datasets .pull-left[ <figure> <img src="img/10/datasciencesteps.png" alt="ZZZ" title="ZZZ" width="100%"> </figure> ] .pull-right[ - Identifying structure that might otherwise be hidden - Diagnosing models and interpreting results - Aiding the sense-making process ] --- # Clarity in presentation - Zooming allows the user to determine scale of presentation - Hovering allows more information to be displayed 'on-demand' - Subsetting facilitates ease of interpretation --- # Clarity in presentation .pull-left[ <img src="10-slides_files/figure-html/gplot-1.png" width="504" style="display: block; margin: auto;" /> ] .pull-right[
] --- # Telling a story - Order of information can evoke emotional connections - That reaction helps make your analysis memorable - [The Shape of Stories](https://youtu.be/oP3c1h8v2ZQ?t=21) - More on this next week --- name: ucd class: center middle main-title section-title-4 # Designing for the User --- # Who is your audience? - Your advisor and colleagues? - An external collaborator? - The general public? - User archetypes --- # Iteration .pull-left[ <figure> <img src="img/10/ucdexample.png" alt="ZZZ" title="ZZZ" width="100%"> <figcaption>From Usability.gov</figcaption> </figure> ] .pull-right[ - Feedback is critical - Ideation: What _specifically_ does the user need? - Meaning: Are the data clearly defined and explained? Are the conclusions obvious? - Function: Given the usecases, will the application (visualization) actually perform? ] --- name: survey class: center middle main-title section-title-4 # Building interactive visualizations in R --- # A note about APIs - API: Application Programming Interface - A software intermediary that allows two applications to "communicate" - Lots of `R` packages rely on APIs to access data on the web (e.g.,`tidycensus`) - Facilitates reproducibility and powerful web applications built on `R` analyses - May require "keys" and addtional parsing (Mapbox and Google) --- # Interactive maps with `tmap` - Easy extension of your existing `tmap` skills ```r map_nz1 = tm_shape(nz) + tm_polygons() tmap_mode("view") map_nz1 ``` Class Demo --- # Interactive maps with `mapview` Class demo --- # Other options - `leaflet` - `ggmap` - `mapsapi` --- # Animated maps with `tmap` and `gganimate` .pull-left[ ```r urb_anim = tm_shape(world) + tm_polygons() + tm_shape(urban_agglomerations) + tm_dots(size = "population_millions") + tm_facets(along = "year", free.coords = FALSE) tmap_animation(urb_anim, filename = "urb_anim.gif", delay = 25) ``` ] .pull-right[ ![dynamic](img/10/urb_anim.gif) ] --- # Coming soon - Telling stories with `plotly` and `flexdashboards`