map_dets: Plots a map of station locations

Description Usage Arguments Details Value See Also Examples

View source: R/s1_proc_inputs.R

Description

This function takes a processed detection history returned by proc_dets() and plots a map showing the relative number of detections per station.

Usage

1
2
3
4
map_dets(proc_det, base_layers = NULL,
             base_borders = NULL, base_cols = NULL,
             sta_col = "black", sta_bg = "red",
             leg_pos = "bottomleft", set_par = TRUE, ...)

Arguments

proc_det

A data.frame of class dets as returned by the function proc_dets(). Defaults to integer 4326, indicating EPSG code 4326 for WGS 84 lat/long.

base_layers

A list of georeferenced vectors to be plotted as the basemap under the stations. Designed to be sfc LINESTRING or POLYGON objects.

base_borders

A list of colors to used to outline the polygons listed in base_layers. Should be the same length as base_layers.

base_cols

A list of colors to used to fill the polygons listed in base_layers. Should be the same length as base_layers.

leg_pos

Indicates where the legend should be. Can be any x that the base graphics function legend will accept. Defaults to the text string "bottomleft". Not applicable if use_ggplot is TRUE.

xlim

Vector of length 2 giving the limits of the plot along the x-axis (longitude or easting).

ylim

Vector of length 2 giving the limits of the plot along the y-axis (latitude or northing).

set_par

TRUE or FALSE. Should the function change the graphical parameters or not? This should be FALSE if the user wishes to manually set the graphical parameters, e.g., so that they can still add to the plot manually after it is generated. Not applicable if use_ggplot is TRUE.

return_df

TRUE or FALSE. Should the function also return a data.frame of aggregated station detections?

use_ggplot

TRUE or FALSE. Should the plot be made using ggplot2? Defaults to FALSE and uses base R plotting. Note: if both return_df and use_ggplot are TRUE, then function returns a list. See details.

...

Additional arguments (not currently implemented)

Details

Details here.

Note that if both return_df and use_ggplot are TRUE, then function returns a list with elements df containing the data.frame of aggregated detections and ggplot containing the ggplot object for the user to further manipulate.

Value

Plots a figure of station activity over time.

See Also

proc_dets for details on the formatting of the data.frame proc_det

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#Load the example data set
data(acoustic)

#Process detections
proc.det <- proc_dets(det = acoustic$detections, sta = acoustic$stations)

#Map detections with all defaults
map_dets(proc.det)

#Map detections with custom settings
map_dets(proc_det = proc.det,
    base_layers = list(acoustic$study_area, acoustic$land),
    base_cols = list("gray30", "wheat"), base_borders = list(NA, "seagreen"),
    xlim=c(-64.628, -64.612), ylim=c(17.770, 17.795),
    leg_pos = "topleft", sta_col = "blue", sta_bg = "orange")

bsmity13/ADePTR documentation built on Nov. 9, 2019, 12:43 a.m.