upload_tiles | R Documentation |
Upload dataset to your Mapbox account
upload_tiles(
input,
username,
access_token = NULL,
tileset_id = NULL,
tileset_name = NULL,
keep_geojson = FALSE,
multipart = FALSE
)
input |
An |
username |
Your Mapbox username |
access_token |
Your Mapbox access token; must have secret scope |
tileset_id |
The ID of the tileset in your Mapbox account |
tileset_name |
The name of the tileset in your Mapbox account |
keep_geojson |
Whether or not to keep the temporary GeoJSON used to
generate the tiles (if the input is an |
multipart |
Whether or not to upload to the temporary AWS staging bucket
as a multipart object; defaults to |
## Not run:
# Example: create a tileset of median age for all United States Census tracts
# Requires setting a Mapbox secret access token as an environment variable
library(mapboxapi)
library(tidycensus)
options(tigris_use_cache = TRUE)
median_age <- get_acs(
geography = "tract",
variables = "B01002_001",
state = c(state.abb, "DC"),
geometry = TRUE
)
upload_tiles(
input = median_age,
username = "kwalkertcu", # Your username goes here
tileset_id = "median_age",
tileset_name = "us_median_age_2014_to_2018"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.