Usage
timeAverage(mydata, avg.time = "day", data.thresh = 0,
statistic = "mean", percentile = NA, start.date = NA,
vector.ws = FALSE, fill = FALSE)Arguments
mydata
A data frame containing a date field
. Can be class POSIXct or Date.
avg.time
This defines the time period to average
to. Can be sec, min, hour,
day, DSTday, week,
month, quarter or
data.thresh
The data capture threshold to use
(%). A value of zero means that all available data will
be used in a particular period regardless if of the
number of values available. Conversely, a value of 100
will mean that all data will need to be presen
statistic
The statistic to apply when aggregating
the data; default is the mean. Can be one of
mean, max, min,
median, frequency, sd,
percentil
percentile
The percentile level in % used when
statistic = "percentile". The default is 95.
start.date
A string giving a start date to use.
This is sometimes useful if a time series starts between
obvious intervals. For example, for a 1-minute time
series that starts 2009-11-29 12:07:00 that
needs to be averaged up to 15-minute