@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(leafle
tR)
m <- leaflet()
m
Produces
@MicheleTobias @GeospatialUCD
A more complex example...
(switch to R)
@MicheleTobias @GeospatialUCD
Data Types
GeoJSON
TopoJSON
Conversion tools available in the package
Generally 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
Tutorials
LeafletR Documentation:
http://cran.r-project.org/web/packages/leafletR/lea
fletR.pdf
HTML & Javascript: http://www.w3schools.com/
Leaflet: http://leafletjs.com/examples.html
Related but different package: Leaflet for R
http://rstudio.github.io/leaflet/

Maps with leafletR