res_custom_map: Local Reserve Map for Custom Stations

Description Usage Arguments Details Value Author(s) Examples

View source: R/res_custom_map.R

Description

Create a stylized reserve-level map of custom station locations for use with the reserve level reporting template

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
res_custom_map(
  stations,
  x_loc,
  y_loc,
  bbox,
  shp,
  station_labs = TRUE,
  station_col = NULL,
  lab_loc = NULL,
  scale_pos = "bottomleft"
)

Arguments

stations

chr string of the reserve stations to include in the map

x_loc

num vector of x coordinates for stations

y_loc

num vector of y coordinates for stations

bbox

a bounding box associated with the reserve. Must be in the format of c(X1, Y1, X2, Y2)

shp

SpatialPolygons object

station_labs

logical, should stations be labeled? Defaults to TRUE

station_col

chr vector of colors used to color station points. Defaults to 'black'.

lab_loc

chr vector of 'R' and 'L', one letter for each station. if no lab_loc is specified then labels will default to the left.

scale_pos

scale_pos where should the scale be placed? Options are 'topleft', 'topright', 'bottomleft', or 'bottomright'. Defaults to 'bottomleft'

Details

Creates a stylized, reserve-level base map. The user can specify the reserve and stations to plot. The user can also specify a bounding box. For multi-component reserves, the user should specify a bounding box that highlights the component of interest.

This function does not automatically detect conflicts between station labels. The lab_loc argument allows the user to specify "R" or "L" for each station to prevent labels from conflicting with each other.

This function is intended to be used with mapview::mapshot to generate a png for the reserve-level report.

Value

Returns a leaflet object

Author(s)

Julie Padilla

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
### set plotting parameters
stns <- c('custom stn 1', 'custom stn 2')
x_coords <- c(-121.735281, -121.750369)
y_coords <- c(36.850377, 36.806667)
shp_fl <- elk_spatial
bounding_elk <- c(-121.810978, 36.868218, -121.708667, 36.764050)
lab_dir <- c('L', 'R')
pos <- 'bottomleft'

### plot
res_custom_map(stations = stns, x_loc = x_coords, y_loc = y_coords,
bbox = bounding_elk, lab_loc = lab_dir, scale_pos = pos, shp = shp_fl)


res_custom_map(stations = stns, x_loc = x_coords, y_loc = y_coords,
bbox = bounding_elk, lab_loc = lab_dir, scale_pos = pos,
shp = shp_fl, station_col = c('red', 'green'))

SWMPrExtension documentation built on Aug. 30, 2020, 5:06 p.m.