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)
Same Data Served Data Shared Data
R is a free open-source statistical software.
RStudio is an interface to using R.
Shiny transforms R code into web applications
Data
Application Code
Place to deploy apps
Database
Data warehouse
Excel, json, csv, etc.
User interface code
Server code
Shinyapps.io
Open source server
Professional server
RStudio Connect
Rich Majerus
rmajerus@colby.edu
@richmajerus
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