Description Usage Arguments Value Examples
View source: R/enumerate_seasons.R
enumerate_seasons
categorizes rows by an annual season
defined by start_*
and end_*
parameters. The resulting object
includes a season_year
column indicating which season the date is
considered part of. This is generally only used for internal data
processing by summarize_*
functions.
1 2 3 4 5 6 7 | enumerate_seasons(
data,
start_month,
end_month,
start_day = 15,
end_day = start_day
)
|
data |
long-format data frame with weather data including a
column |
start_month |
numeric starting month defining season (inclusive) |
end_month |
numeric ending month defining season (inclusive) |
start_day |
numeric day of starting month defining season (inclusive); defaults to 15 |
end_day |
numeric day of ending month defining season (inclusive);
defaults to |
A copy of the passed data
data frame with an additional
column, season_year
indicating the year of the season that the
observation "belongs" to. For seasons that do not cross the new year,
this is simply the year the observation was made. For seasons that do
include the new year (e.g. a season starts in November and ends in the
subsequent March), season_year
is defined as the year in which the
season starts. That is, for a season spanning November through March, the
value of season_year
for observations in January, February, and March
is the prior year (e.g. season_year
for an observation on 1983-02-01
for a season spanning November through March would be 1984).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
# to_long and enumerate_seasons are internal functions, hence the triple-
colon (:::)
# enumerate_seasons expects long-formatted data
rain_long <- wxsumR:::to_long(data = rain_2yr)
# enumerate seasons, defined by 30 November through 15 March
rain_seasons <- wxsumR:::enumerate_seasons(data = rain_long,
start_month = 11,
end_month = 3,
start_day = 30,
end_day = 15)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.