leafletMapDF: Leaflet interactive map widget

Description Usage Arguments Value See Also Examples

Description

Launches a Shiny App an interactive Leaflet map which can be used to visualize coordinate data. Intended for quick exploratory geographic analyses

Usage

1
leafletMapDF(data, vars = c(lon = "longitude", lat = "latitude"))

Arguments

data

data.frame or data.table of data to visualize on map. Included must be a column for longitude and latitude coordinates. Four additional columns are allowed for filtering and coloring the data. Note, the filters are currently only categorical, not currently supporting numeric ranges. Recommend only passing columns needed for filtering. Default is to pick first 4

vars

named character vector. The names of the vector should always be 'lon' and 'lat'. The corresponding values of this vector are the column names of the columns in data with the lat and lon data.

Value

Shiny App

See Also

leaflet, shiny

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
n <- 5000
df <- data.frame(latitude=runif(n, 35, 40),
                 longitude=runif(n, -100, -85),
                 animals=sample(c('dogs', 'cats', 'turtles'), n, replace=T)
                 )
df$westness <- cut(df$longitude, breaks=seq(min(df$longitude), max(df$longitude), length.out=10))
df$northness <- cut(df$latitude, breaks=seq(min(df$latitude), max(df$latitude), length.out=10))
leafletMapDF(df)

## End(Not run)

brooksandrew/Rsenal documentation built on May 13, 2019, 7:50 a.m.