Skip to contents

Adds a prefix to a set of cameras, previously verifying that the prefix is not in the camera name.

Usage

add_location_prefix(cameras, locations, logger = NA)

Arguments

cameras

a character vector of camera names

locations

a character vector of locations (must be the same length as cameras)

logger

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

Value

A character vector of the same length as cameras where each value is prefixed with the corresponding value of locations (in the same order). The function will not double the prefix in case it was already present.

Examples

cameras <- c("A01", "B01", "KAR_A01")
locations <- c("KAR", "KAR", "KAR")
add_location_prefix(cameras, locations)
#> [1] "KAR_A01" "KAR_B01" "KAR_A01"