addMeasures: Add Measures

View source: R/addMeasures.R

addMeasuresR Documentation

Add Measures

Description

Adds "measures" to an AcousticStudy or AcousticEvent. A "measure" is an event-level variable that will be exported alongside data from that event

Usage

addMeasures(x, measures, replace = TRUE)

getMeasures(x)

Arguments

x

an AcousticStudy or AcousticEvent object

measures

the measures to add. Can either be a named list, where names match event names of x or a dataframe with column eventId matching the event names of x. If a list, every item within the list must also be named by the variable name. All other data within measures will be added as new measures

replace

logical flag whether or not to replace

Value

object of same class as x with measures added

Author(s)

Taiki Sakai taiki.sakai@noaa.gov

Examples


data(exStudy)
measList <- list('Example.OE1' = list(a=1, b=2),
                 'Example.OE2' = list(a=2, b=3)
                 )
exMeasure <- addMeasures(exStudy, measList)
print(getMeasures(exMeasure))
measDf <- data.frame(eventId = c('Example.OE1', 'Example.OE2'),
                     a=4:5,
                     b=6:7)
exMeasure <- addMeasures(exMeasure, measDf, replace=TRUE)
getMeasures(exMeasure)


PAMpal documentation built on Aug. 12, 2023, 1:06 a.m.