View source: R/basicStatsMetric.R
basicStatsMetric | R Documentation |
The basicStatsMetric() function calculates the min, median, mean, max, rmsVariance
and number of unique values for
the input seismic signal.
basicStatsMetric(st)
st |
a |
This metric applies the min, median, mean
and max
methods of Stream
objects
to the st
parameter to calculate the following metrics:
sample_min
sample_median
sample_mean
sample_max
sample_rms
It also calculates length(unique(stmerged@traces[[1]]@data))
, where stmerged is the st parameter after mergeTraces
is applied to it, for the following metric:
sample_unique
Any error messages generated in the process will pass through untrapped.
A list of SingleValueMetric
objects is returned.
See the seismic
package for documentation on Stream
objects and the getDataselect
method.
Jonathan Callahan jonathan@mazamascience.com
## 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, inclusiveEnd=FALSE)
# Calculate some metrics and show the results
metricList <- basicStatsMetric(st)
dummy <- lapply(metricList, show)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.