Description Usage Arguments Value See Also Examples
Launches a Shiny App an interactive Leaflet map which can be used to visualize coordinate data. Intended for quick exploratory geographic analyses
1 | leafletMapDF(data, vars = c(lon = "longitude", lat = "latitude"))
|
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 |
Shiny App
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.