saveMetricList: Save a MetricList as RData or XML

View source: R/BSSUtils.R

saveMetricListR Documentation

Save a MetricList as RData or XML

Description

The saveMetricList() function allows metrcis to be saved as either .RData files or as XML. The XML format is the same as that used by the IRIS DMC MUSTANG database for metric submission.

Usage

saveMetricList(metricList, id=Sys.getpid(), rdata=FALSE)

Arguments

metricList

list of SingleValueMetric objects

id

ID to be used when generating output files

rdata

optional flag to save the incoming metricList as a .RData file

Details

The saveMetricList function saves a list of SingleValueMetrics as a .RData binary file or converts the list into the XML format expected by the MUSTANG database submission process. This XML format is human readable and can be used to spot check results of metrics calculations.

Value

The automatically generated filename is returned invisibly.

Author(s)

Jonathan Callahan jonathan@mazamascience.com

See Also

SingleValueMetric-class, metricList2Xml, getMetricsXml, getBssMetricList,

Examples

  ## Not run: 
# Open a connection to IRIS DMC webservices
iris <- new("IrisClient")

# Get the waveform
starttime <- as.POSIXct("2012-01-24", tz="GMT")
endtime <- as.POSIXct("2012-01-25", tz="GMT")
st <- getDataselect(iris,"AK","PIN","","BHZ",starttime,endtime)

# Apply a metric and show the results
metricList <- stateOfHealthMetric(st)
metricList <- append(metricList, basicStatsMetric(st))
saveMetricList(metricList,id='AK.PIN..BHZ')
  
## End(Not run)

IRISMustangMetrics documentation built on Aug. 22, 2023, 9:11 a.m.