View source: R/annual_longest_spell.R
annual_longest_spell | R Documentation |
Calculates the length of the longest period each year for which the spell condition is valid
annual_longest_spell(
data,
element,
station = NULL,
date = NULL,
year = NULL,
spell_type = c("between", "lte", "gte", "excluding between"),
lower = 0,
upper = 0.85,
doy = NULL,
doy_first = 1,
doy_last = 366,
result_name = "max_spell",
na.rm = FALSE
)
data |
The data.frame to calculate from |
element |
The name of the column in |
station |
The name of the station column in |
date |
The name of the date column in |
year |
The name of the year column in |
spell_type |
The spell condition type. One of "between", "lte" (less than or equal to), "gte" (greater than or equal to) or "outside". See details for explanation. |
lower |
The lower value of the spell condition (does not apply to spell type = "gte"). |
upper |
The lower value of the spell condition (does not apply to spell type = "lte"). |
doy |
The name of the day of the year (1-366) column in |
doy_first |
The first day of the year to consider the longest spell within. |
doy_last |
The last day of the year to consider the longest spell within. |
result_name |
The name of column of the length of the longest spell period in the resulting summary dataset. |
na.rm |
A logical value. Should |
A summary data.frame of the annual longest spell (for each station).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.