maps with leafletr
TRANSCRIPT
@MicheleTobias @GeospatialUCD
Maps with leafletR
Michele M. Tobias, PhD
Feb. 20th, 2015 ▪ UC Davis R Users Group
@MicheleTobias @GeospatialUCD
What is Leaflet?
Javascript library
Used in web pages
Makes interactive web maps
Example: http://micheletobias.github.io/maps/DistributionsMap.html
@MicheleTobias @GeospatialUCD
What is leafletR?
Package for R
User enters commands into an R terminal
Generates Leaflet javascript commands for you
Output is an HTML document that can be viewed in a web browser
@MicheleTobias @GeospatialUCD
Some Simple Code:
library(leafletR)
m <- leaflet()m
Produces
@MicheleTobias @GeospatialUCD
A more complex example...
(switch to R)
@MicheleTobias @GeospatialUCD
Data Types
GeoJSONTopoJSON
Conversion tools available in the packageGenerally requires columns for Lat & Long
@MicheleTobias @GeospatialUCD
Concerns
Default Projection = Web Mercator
Not designed for use in print publications
Terms of Service for base maps used
@MicheleTobias @GeospatialUCD
TutorialsLeafletR Documentation: http://cran.r-project.org/web/packages/leafletR/leafletR.pdfHTML & Javascript: http://www.w3schools.com/
Leaflet: http://leafletjs.com/examples.html
Related but different package: Leaflet for R http://rstudio.github.io/leaflet/