Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

PAMpal (version 1.4.4)

addWaveHeight: Add Wave Height Data to an AcousticStudy

Description

Add wave height to an AcousticStudy or AcousticEvent

Usage

addWaveHeight(x, height, thresh = 3600)

Value

the same data as x, with wave height data added. All AcousticEvents will have height data added to all detector dataframes as column waveHeight

Arguments

x

an AcousticStudy to add height data to

height

either a single numeric value, or a dataframe with column UTC and either column waveHeight specifying height (m) at that time, or beaufort specifying the beaufort sea state at that time

thresh

maximum time apart in seconds for matching height to data, if the closest value is more than thresh apart then the height value will be set to NA

Author

Taiki Sakai taiki.sakai@noaa.gov

Details

height 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 height data is provided.

Examples

Run this code

data(exStudy)
# need to update database file to local directory
exStudy <- addWaveHeight(exStudy, height=.5)
getClickData(exStudy[1])

Run the code above in your browser using DataLab