View source: R/filterRecordTable.R
filterRecordTable | R Documentation |
Filter species record table for temporal independence
filterRecordTable(
recordTable,
minDeltaTime = 0,
deltaTimeComparedTo,
speciesCol = "Species",
stationCol,
cameraCol,
camerasIndependent,
recordDateTimeCol = "DateTimeOriginal",
recordDateTimeFormat = "ymd HMS",
removeDuplicateRecords = TRUE,
exclude,
timeZone,
writecsv = FALSE,
outDir,
eventSummaryColumn,
eventSummaryFunction,
quiet = FALSE
)
recordTable |
data frame as created by |
minDeltaTime |
integer. Time difference between records of the same species at the same station to be considered independent (in minutes) |
deltaTimeComparedTo |
character. For two records to be considered
independent, must the second one be at least |
speciesCol |
character. name of the column specifying species in
|
stationCol |
character. Name of the camera trap station column. Assuming "Station" if undefined. |
cameraCol |
character. Name of the column specifying cameras in
|
camerasIndependent |
logical. If |
recordDateTimeCol |
character. Name of the column specifying date and
time in |
recordDateTimeFormat |
character. Format of column
|
removeDuplicateRecords |
logical. If there are several records of the same species at the same station (also same camera if cameraID is defined) at exactly the same time, show only one? |
exclude |
character. Vector of species names to be excluded from the record table |
timeZone |
character. Must be a value returned by
|
writecsv |
logical. Should the record table be saved as a .csv? |
outDir |
character. Directory to save csv to. If NULL and
|
eventSummaryColumn |
character. A column in the record table (e.g. from
a metadata tag) by to summarise non-independent records (those within
|
eventSummaryFunction |
character. The function by which to summarise
|
quiet |
logical. If TRUE, suppress printing of progress. |
A data frame containing species records and additional information about stations, date, time, filtered for temporal independence.
Juergen Niedballa
if (Sys.which("exiftool") != ""){ # only run example if ExifTool is available
# set directory with camera trap images in station directories
wd_images_ID_species <- system.file("pictures/sample_images_species_dir",
package = "camtrapR")
# create record table without temporal filtering
rec_table <- recordTable(inDir = wd_images_ID_species,
IDfrom = "directory",
minDeltaTime = 0,
exclude = "UNID",
timeZone = "Asia/Kuala_Lumpur",
removeDuplicateRecords = TRUE
)
# filter for 60 minutes temporal independence
rec_table_filt <- filterRecordTable(recordTable = rec_table,
minDeltaTime = 60,
stationCol = "Station",
deltaTimeComparedTo = "lastIndependentRecord")
nrow(rec_table)
nrow(rec_table_filt)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.