Learn R Programming

okmesonet (version 0.1.5)

avgokmts: Average an Oklahoma Mesonet time series data frame

Description

Summarize an Oklahoma Mesonet time series (MTS) data frame returned by okmts. Summary can be by hour, day, month, or year. Precipitation (variable RAIN) is returned as totals within the given time period.

Usage

avgokmts(mts, by, metric = "mean")

Arguments

mts
data frame returned by okmts.
by
character string indicating time period to average over. May include "hour", "day", "month", or "year".
metric
function to summarize with. Default is "mean" (average), but may also include "min", "max", and "sd" for minimum, maximum, and standard deviation, respectively.

Value

A data frame summarizing Mesonet measurements by station and given time period.

Examples

Run this code
## Not run: 
# ## Retrieve Bessie station MTS files for 00:00 Jun 01, 1997
# ## through 23:55 Oct 31, 1997
# bess.mts <- okmts(begintime="1997-06-01 00:00:00",
#  endtime="1997-10-31 23:55", station="bess")
# 
# ## Average MTS data by day.
# bess.mts.avg  <- avgokmts(bess.mts, by="day")
# ## End(Not run)

Run the code above in your browser using DataLab