
Add datetime-related columns from BirdNET output filenames
Source:R/utils_column_editing.R
birdnet_add_datetime.Rd
Extracts and parses datetime information from filenames in the file path column
(automatically detected), then adds several useful time-related columns
(e.g., date
, year
, month
, hour
) to the input data frame.
Value
A data frame with additional columns:
- datetime
POSIXct datetime parsed from the filename.
- date
Date portion of the datetime.
- year
Year of detection.
- month
Month of detection.
- mday
Day of the month.
- yday
Day of the year.
- hour
Hour of the day.
- minute
Minute of the hour.
Details
The function uses birdnet_detect_columns to find the column
containing file paths based on common name patterns (e.g., "file", "path").
Filenames are expected to contain a datetime string in the format
"YYYYMMDD_HHMMSS"
or similar.
Examples
if (FALSE) { # \dontrun{
combined_data <- birdnet_combine("path/to/BirdNET/output")
data_with_time <- birdnet_add_datetime(combined_data)
} # }