MABM_route: MABM shapefile creation, preparation for database import, and...

Description Usage Arguments Details

View source: R/MABM_route.R

Description

This function associates bat calls classified with Bat Call Identification (BCID; http::/www.batcallid.com) software with simultaneously collected geographic location information. For this application, bat calls were collected with (usually) an Anabat SD2 or the older Anabat SD1 (https://www.titley-scientific.com) and georeference by integrating the Anabat data logger, PDA and an external GPS. From this association, it also creates multiple shapefiles and a *.csv for incorporation into the MABM Access database. If requested, suspected noise files can be scrubbed (moved) to a new subdirectory.

Usage

1
2
3
MABM_route(route_name = NULL, scrub = TRUE, gps = TRUE,
  for_import = TRUE, keep_output = FALSE, overwrite = FALSE,
  plot = FALSE)

Arguments

route_name

character string indicating the name used to file the created output. Default (NULL) prompts the user to select from a list of all MABM routes. This argument is useful primarily when processing data external to the MABM program (e.g., data collected along a non-MABM route)

scrub

logical indicating whether Anabat files (ending with '#'), if present, identified as noise (i.e., not assigned an ID in BCID) should be scrubbed (moved) to a newly created 'scrubbed' subdirectory (default = TRUE); non-scrubbed files are not moved

gps

logical (default = TRUE) indicating whether the a GPS file is available to georeference the BCID classification file

for_import

logical indicating whether the output *.csv file should be formatted for import into the MABM Access database (default = TRUE). See details.

keep_output

logical (default = FALSE) that creates a list containing potentially useful outputs.

overwrite

logical (default = FALSE) indicating whether to overwrite the output directory and files, if they exist.

plot

logical (default = FALSE) indicating whether to plot the processed route using plot_MABM_route

Details

If for_import = TRUE, the function will rearrange the columns to match the expected import format of the MABM database and replace NAs with blanks to play nicely with expected variable types. This necessitates conversion of most (all?) columns to text strings (which is not very handy if you want to work with the output in R). This argument is forced to for_import = FALSE if the user specifies keep_output = TRUE.

If keep_output = TRUE, the function creates a list containing (1) a data.frame ('final_calls') containing information on the bat detections, (2) a sf ('route_pt') of all GPS fixes along the route, (3) a sf of these GPS fixes, and (4) a sf ('call_pt') of all bat detections. This is handy if the user wants to conduct further investigations in R. To access this output, remember to assign the function output to an R object.


adamdsmith/MABM documentation built on Aug. 22, 2019, 8:27 a.m.