Skip to contents

Standardize cameras names

Usage

clean_cameras(
  cameras,
  locations,
  classifiers,
  silence_warnings = FALSE,
  logger = NA
)

Arguments

cameras

Cameras vector

locations

locations vector

classifiers

Classifier vector. If the classifier is NULL, the function will apply all Zooniverse corrections.

silence_warnings

Should a warning be displayed when locationID is NA?

logger

a log4r logger object if you want logging (can be created with create_logger), else NA.

Value

a character vector of cameras with the same length as input.

Details

For all data: will add the location prefix.

For TrapTagger data:

  • if the location code is KHO: will remove the dash in the camera name (e.g KHO_E_A01 -> KHO_EA01)

  • if the location code is SAM: will remove the dash in the camera name (e.g SAM_B_A01 -> SAM_BA01)

  • if the location code is SAM: will remove the dash in the camera name (e.g TSW_L_A01 -> TSW_LA01)

  • if the location code is PLN: will replace leading PIL_ with PLN (e.g PIL_A01 -> PLN_A01) For Zooniverse data:

  • if the location code is KHO, will replace KHOG with E and KHOL with M in cameras (and add location prefix).

  • if the location code is DHP, will remove leading D in cameras (and add location prefix).

  • if the location code is OVE, will remove leading O in cameras (and add location prefix).

Examples

cameras <- c("KHO_E_A01", "OCO2")
locations <- c("KHO", "OVE")
classifiers <- c("traptagger", "zooniverse")
clean_cameras(cameras, locations, classifiers)
#> [1] "KHO_EA01" "OVE_CO2"