View source: R/addRecordings.R
| addRecordings | R Documentation |
Adds recording files to an AcousticStudy object, runs interactively to allow users to select files if they are not provided. No actual recordings are stored, a dataframe containing information on the start and end times of the recording files is added to the object.
addRecordings(
x,
folder = NULL,
log = FALSE,
fileFormat = NULL,
dateFormat = NULL,
progress = TRUE
)
mapWavFolder(
folder = NULL,
log = NULL,
progress = TRUE,
fileFormat = NULL,
dateFormat = NULL
)
x |
a AcousticStudy object to add recordings to |
folder |
a folder of recordings to add. If |
log |
(optional) log files for SoundTrap recordings. These are used to
adjust apparent lengths of recordings for missing data. If |
fileFormat |
optional file date format regex to extract date from file names See Details for more information. |
dateFormat |
matching date format for |
progress |
logical flag to show progress bars |
Custom Date Format using fileFormat and dateFormat.
This is optional, and only required if the built in options do not work
and you get the warning message "Could not convert wav names to time properly
for files..."
fileFormat must be a regular expression designed to extract the
numbers that represent the datetime from the recording file, and only
these numbers. This portion of the regex must be wrapped in parentheses.
dateFormat must be a strptime style date format that matches the
datetime text extracted by fileFormat.
Examples: a wav file named "Recording_20101201-230112.wav" (where the
numbers are in yyyymmdd-hhmmss) would have
fileFormat=".*_([0-9]{8}\\-[0-9]{6})\\.wav$" and
dateFormat="%Y%m%d-%H%M%S".
A wav file named "01122010230112_CH2.wav" (where the numbers are in
ddmmyyyyhhmmss) would have
fileFormat="([0-9]{14})_CH[0-9]{1}\\.wav$" and
dateFormat="%d%m%Y%H%M%S". Both examples are for a file datetime
of "2010-12-01 23:01:12".
mapWavFolder returns a dataframe of start and end times
the same object as x with recording information added
to the files slots. The information added is a dataframe containing
the start and end times of recording
Taiki Sakai taiki.sakai@noaa.gov
data(exStudy)
recs <- system.file('extdata', 'Recordings', package='PAMpal')
exStudy <- addRecordings(exStudy, folder=recs, log=FALSE, progress=FALSE)
files(exStudy)$recordings
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.