metricList2DF | R Documentation |
The metricList2DF
function converts a list of SingleValueMetric
s into a
"tidy" dataframe with one value per row..
metricList2DF(metricList)
metricList |
a list of |
Metrics functions return lists of SingleValueMetric
objects. A long metricList
may be built up
by appending the results of different metrics functions or the same metrics function operating on different seismic signals.
A metricList generated by any of the MUSTANG Rscripts can be stored as an .RData
file and reloaded for examination.
A metricList may contain values for many different metrics. This function creates a single "tidy" dataframe with
the following colulmns: metricName, value, snclq, starttime, endtime, qualityFlag
.
A dataframe with one row per metric measurement.
Jonathan Callahan jonathan@mazamascience.com
SingleValueMetric-class
,
metricList2Xml
## Not run:
# Open a connection to IRIS DMC webservices
client <- new("IrisClient")
# Get the waveforms
starttime <- as.POSIXct("2012-01-24", tz="GMT")
endtime <- as.POSIXct("2012-01-25", tz="GMT")
st1 <- getDataselect(client,"AK","PIN","","BHE",starttime,endtime)
st2 <- getDataselect(client,"AK","PIN","","BHN",starttime,endtime)
st3 <- getDataselect(client,"AK","PIN","","BHZ",starttime,endtime)
# Calculate metrics and append them to the metricList
metricList <- stateOfHealthMetric(st1)
metricList <- append(metricList, basicStatsMetric(st1))
metricList <- append(metricList, basicStatsMetric(st2))
metricList <- append(metricList, basicStatsMetric(st3))
# Create dataframe
metricDF <- metricList2DF(metricList)
head(metricDF)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.