annual_max | R Documentation |
annual_max() takes a data frame of daily (or sub-daily) observations and returns a summary of the annual maximum and mean values, the date/time of each annual maximum, and the fraction of "on-the-hour" samples (data completeness) for each calendar year.
annual_max(DF, record_attribute = "sea_level")
DF |
A data.frame containing at least:
|
record_attribute |
A character string giving the name of the column in DF containing the values. Defaults to "sea_level". |
For each year, only observations exactly on the hour (minute == 0 & second == 0) are counted toward completeness. If no valid data exist for a year, that year is dropped from the output.
a data.frame containing a date column and a numeric column (specified in record_attribute) for years where at least one nonNA value is present, containing:
annMax - the annual maximum
annMean - the annual mean (calendar year)
datestr - the date/time of the annual maximum, formatted "YYYYmmddHH"
date - the POSIXlt timestamp of the annual maximum
pc_complete - the fraction (0 to 1) of hourly-timestamped samples available in that year
# generate example daily data
dates <- seq.Date(as.Date("1990-01-01"), as.Date("1995-12-31"), by = "day")
DF <- data.frame(
date = dates,
sea_level = rnorm(length(dates), mean = 0, sd = 1)
)
# compute annual summary
am <- annual_max(DF)
head(am)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.