View source: R/addHydrophoneDepth.R
addHydrophoneDepth | R Documentation |
Add hydrophone depth to an AcousticStudy or AcousticEvent
addHydrophoneDepth(x, depth = NULL, depthCol = NULL, thresh = 60, ...)
x |
an AcousticStudy to add depth data to |
depth |
a CSV or data frame of depth values to match to data from |
depthCol |
the name of the column containing depth in the dataframe or
database. If left as |
thresh |
maximum time apart in seconds for matching depth to
data, if the closest value is more than |
... |
additional arguments for other methods |
Depth values will be matched to the data
by using data.table's rolling join with roll='nearest'
. After the
join is done, the time difference between the matched rows is checked
and any that are greater than the set threshold are set to NA. This is
done to prevent accidentally matching weird things if an incomplete set
of depth data is provided.
If x
is an AcousticEvent or AcousticStudy,
then depth
can be omitted and will be read from the databases contained
in the files
slot of x
.
the same data as x
, with depth data added. All AcousticEvents will
have depth data added to all detector dataframes as column hpDepth
Taiki Sakai taiki.sakai@noaa.gov
data(exStudy)
# need to update database file to local directory
db <- system.file('extdata', 'Example.sqlite3', package='PAMpal')
exStudy <- updateFiles(exStudy, db=db, bin=NA, verbose=FALSE)
exStudy <- addHydrophoneDepth(exStudy)
getClickData(exStudy[1])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.