avgokmts: Average an Oklahoma Mesonet time series data frame

Description Usage Arguments Value Examples

View source: R/avgokmts.R

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

1
  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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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)

okmesonet documentation built on May 2, 2019, 6:39 a.m.