Description Usage Arguments Value Examples
View source: R/enumerate_seasons.R
Value for season year for observation
1 | season_year(x, start_month, end_month, start_day = 15, end_day = start_day)
|
x |
vector of Date data |
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 |
integer vector of season year to which observation corresponds 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 | ## Not run:
dates <- as.Date(x = c("1983-12-15", "1984-03-01", "1984-12-15", "1985-03-01"))
# identify season year, where season is defined as 30 November through
# 15 March
sy <- season_year(x = dates,
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.