create_bm | R Documentation |
Use open street map data to create a basemap with the extent of the data
create_bm( DT, lat = "lat", lon = "lon", buffer = 1000, sc_dist, squared = FALSE, projection = paste0("+proj=laea +lat_0=90 +lon_0=-156.653428 +x_0=0 +y_0=0", " +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0 ") )
DT |
Name of the data.table |
lat |
Name of the column with latitude (as.character) |
lon |
Name of the column with longitude (as.character) |
buffer |
Buffer around the data |
sc_dist |
Distance of the scale |
squared |
If true buffer is created around the centre and outline squared |
projection |
Projection of the data (default is equal area with centre Barrow) |
bm, a ggplot2 base map
# create table with two points DT = data.table(name = c('NARL', 'Utqiagvik'), lat = c(71.320854, 71.290246), lon = c(-156.648210, -156.788622)) # change projection st_transform_DT(DT) # create base map bm = create_bm(DT) bm
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.