Where Have All the Prospects Gone?

Rich Majerus

 

Presentation Materials: https://github.com/majerus/NEDRA2018

View slides on your device: https://goo.gl/2DUJCb

# load leaflet library
library(leaflet)

# initialize html widget
# add default map tile
leaflet() %>%
    addTiles()
    
# load packages
library(rvest)
library(ggmap)

# read NEDRA events page html
nedra_html <- 
    read_html("https://www.nedra.org/upcomingprograms")

# extract event locations
location <- 
  nedra_html %>% 
  html_nodes(".eventInfoLocation span") %>%
  html_text()

# extract event names
name <- 
  nedra_html %>% 
  html_nodes(".eventDetailsLink") %>%
  html_text()

# create tibble 
df <- 
  tibble(location = location,
         name = name) 

# geocode event locations using ggmap::geocode
coords <- 
  bind_rows(
    lapply(df$location, function(x){geocode(x)}))

df <- cbind(df, coords)
  
# create leaflet map
df %>% 
    leaflet() %>% 
      addTiles() %>% 
      addMarkers(popup = ~content)

Unlocking our Data

with Visualization

Source Data for Visualization

Same Data           Served Data           Shared Data

Approach #1: Same Data

Approach #2: Served Data

R is a free open-source statistical software.

RStudio is an interface to using R.

Shiny transforms R code into web applications 

How this works...

Data

Application Code

Place to deploy apps

What you will need...

Database 

Data warehouse

Excel, json, csv, etc.

 

User interface code

Server code

 

Shinyapps.io 

Open source server

Professional server

RStudio Connect

 

Approach #3: Shared Data

Approach #3: Shared Data

  • Linked interactive visualizations
  • Filtering and personalization capability
  • No server required

Where to go from here

Rich Majerus

rmajerus@colby.edu

@richmajerus

Credits

 Madebyoliver from Flaticon licensed by Creative Commons BY 3.0

 smashicons from Flaticon licensed by Creative Commons BY 3.0

 Freepik from Flaticon licensed by Creative Commons BY 3.0

 Freepik from Flaticon licensed by Creative Commons BY 3.0

 Dave Gandy from Flaticon licensed by Creative Commons BY 3.0

 smashicons from Flaticon licensed by Creative Commons BY 3.0

 photos from unsplash.com

Where Have All the Prospects Gone?

By Rich Majerus

Where Have All the Prospects Gone?

  • 1,817