create_bm: Create base map

View source: R/create_bm.R

create_bmR Documentation

Create base map

Description

Use open street map data to create a basemap with the extent of the data

Usage

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 ")
)

Arguments

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)

Value

bm, a ggplot2 base map

Examples

# 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

krietsch/auksRuak documentation built on Feb. 15, 2023, 2:44 p.m.