Learn R Programming

IRISMustangMetrics (version 2.4.6)

saveMetricList: 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)

Value

The automatically generated filename is returned invisibly.

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

Author

Jonathan Callahan jonathan@mazamascience.com

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.

See Also

SingleValueMetric-class, metricList2Xml, getMetricsXml, getBssMetricList,

Examples

Run this code
  if (FALSE) {
# 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')
  }

Run the code above in your browser using DataLab