MABM_report: MABM annual report creation.

Description Usage Arguments Additional details on parameter inputs Example directory hierarchy Map generation in the annual reports

View source: R/MABM_report.R

Description

This function generates an annual report for one or more MABM stations for, by default, the current calendar year. The report includes, for each route associated with a given station, (1) an overview of the year's efforts, (2) a night-by-night tabular summary with notes, if present, (3) a night-by-night tabular summary of species detections, (4) a tabular and graphical comparison of species detections from the current season with previous season(s), and (5) a map of the route indicating the locations of all bat detections for the season.

Usage

1
2
3
4
5
6
7
8
9
MABM_report(
  station = NULL,
  year = as.integer(format(Sys.Date(), "%Y")),
  MABM_dir = NULL,
  update = FALSE,
  distribute = TRUE,
  key = NULL,
  interactive = TRUE
)

Arguments

station

character string indicating the MABM station (e.g., refuge, ES office) for which to produce a report. Default (NULL) prompts the user to select from a list of all available MABM stations. The selection of multiple stations is allowed.

year

integer indicating the year for which to generate the annual report; defaults to the current year

MABM_dir

character string indicating the base directory containing MABM station related data (i.e., MABM route directories with call files, shapefiles, and annual reports). See Details.

update

logical (default = FALSE) indicating whether to call a macro inside the MABM database that exports the data necessary for annual report generation. Generally used (i.e., update = TRUE) only if (1) this is the first time running MABM_report or (2) after the MABM database has been updated.

distribute

logical (default = TRUE) indicating whether to attempt to place the output report in an 'Annual Report' directory within the base directory for each station, if located. To work properly, a specific directory hierarchy is expected (see Details). If 'distribute' = FALSE or distribute attempt fails (see Details), the output is placed in an 'Annual Report' directory beneath MABM_dir.

key

character scalar of Google Maps API key

interactive

logical (default = TRUE) indicating whether to attach an interactive leaflet map (*.html file) of bat detections along a route in a given year. If so, it is attached to, and exported with, the report *.pdf

Additional details on parameter inputs

MABM_dir

This is the base directory containing all relevant data for the whole complement of MABM stations. In short, this base directory should contain a separate directory for each MABM station (e.g., Big Oaks; name is not restricted). Each station directory should in turn contain a directory for *each* route named according to its shortened route name in the MABM database (e.g., BokNWR1 for Big Oaks NWR East route); the station directory may also contain an 'Annual Report' directory. An example hierarchy is shown below.

distribute

When TRUE, the function attempts to place the output in an 'Annual Report' directory located in the base directory for a given MABM station, alongside the separate directories for each route of that station. For this to work properly, the hierarchy outlined above must exist. If 'distribute' = TRUE but a directory matching the shortened route name (e.g., BokNWR1) is not located, or if 'distribute' = FALSE, the output is placed in an 'Annual Reports' directory just beneath the directory identified by 'MABM_dir', which is created if does not exist.

Example directory hierarchy

Map generation in the annual reports

Map generation of detected bats occurs only if three requirements are met:

  1. at least one bat call has been detected

  2. the calls have been successfully georeferenced (i.e., they possess associated location information).

  3. a shapefile (point or line) named with the form 'shortname_canonical_route.shp' (e.g., BokNWR1_canonical_route.shp') is present in its respective route directory


adamdsmith/MABMreportr documentation built on June 5, 2020, 1:39 a.m.