Learn R Programming

⚠️There's a newer version (0.3.6) of this package.Take me there.

mapdeck

What is mapdeck?

An R library which lets you plot large data sets (as much as your GPU & browser can handle), on interactive maps using Mapbox GL and Deck.gl

What is mapbox?

Mapbox is the location data platform for mobile and web applications. We provide building blocks to add location features like maps, search, and navigation into any experience you create.

What is deck.gl?

deck.gl is a WebGL-powered framework for visual exploratory data analysis of large datasets.

How do I use it?

First you need to install it, either from CRAN

install.packages("mapdeck")

Or from github (to get the latest development version)

devtools::install_github("SymbolixAU/mapdeck")

Then everything you need to know to get you started is on the home page

Quick Start

Mapdeck uses Mapbox maps, and to use Mapbox you need an access token.

Once you’ve generate a token you can use their maps.

Call mapdeck(token = 'your_token') to generate a basic map. Then start adding layers by using one of the various add_*() functions.

url <- 'https://raw.githubusercontent.com/plotly/datasets/master/2011_february_aa_flight_paths.csv'
flights <- read.csv(url)
flights$info <- paste0("<b>",flights$airport1, " - ", flights$airport2, "</b>")

mapdeck(token = key, style = mapdeck_style('dark')) %>%
  add_arc(
    data = flights
    , origin = c("start_lon", "start_lat")
    , destination = c("end_lon", "end_lat")
    , stroke_from = "airport1"
    , stroke_to = "airport2"
    , tooltip = "info"
    , layer_id = 'arclayer'
  )

See the Layers page for more examples

Getting help

For general help and advice the best place to ask is on StackOverflow (using the mapdeck tag).

If you’ve found a bug, or want a new feature added then use the issue tracker on github.

I don’t respond to emails asking for help because this is an open source package, and any advice should be kept open so everyone can benefit. (unless you want to pay me!)

Copy Link

Version

Install

install.packages('mapdeck')

Monthly Downloads

3,439

Version

0.3.4

License

GPL-3

Maintainer

David Cooley

Last Published

September 4th, 2020

Functions in mapdeck (0.3.4)

add_geojson

Add Geojson
legend_element

Legend Element
add_terrain

Add terrain
add_sf

Add sf
geojson

Geojson
add_text

Add Text
light_settings

Light Settings
%>%

Pipe
add_title

Add Title
mapdeck-shiny

Shiny bindings for mapdeck
roads

Roads in central Melbourne
add_scatterplot

Add Scatterplot
add_animated_arc

Add animated arc
add_animated_line

Add Animated line
add_mesh

Add Mesh
mapdeck_dispatch

mapdeck dispatch
clear_legend

Clear Legend
clear_tokens

Clear tokens
mapdeck_legend

Mapdeck Legend
add_path

Add Path
add_polygon

Add Polygon
add_pointcloud

Add Pointcloud
melbourne

Polygons in and around Melbourne
add_screengrid

Add Screengrid
city_trail

city_trail
mapdeck_dependencies

Mapdeck Dependencies
mapdeck

mapdeck
clear_animated_arc

Clear Animated Arc
set_token

Set Token
melbourne_mesh

Melbourne Mesh
add_hexagon

Add hexagon
add_heatmap

Add Heatmap
add_bitmap

Add bitmap
update_style

update style
add_arc

Add arc
add_trips

Add Trips
capitals

Capital cities for each country
mapdeck_style

Mapdeck Style
mapdeck_tokens

Mapdeck_tokens
mapdeck_update

Mapdeck update
mapdeck_view

Mapdeck view
add_dependencies

Add Dependencies
add_column

Add column
add_cesium

Add Cesium
add_greatcircle

Add greatcircle
add_grid

Add Grid
add_i3s

Add I3S
add_line

Add line