seasonYear | R Documentation |
Create an ordered factor or numeric values from a vector of dates based on the season of the year.
seasonYear(x, start.month = "June", end.month = "September", numeric = FALSE) seasonYearMD(x, start.day = "06/01", end.day = "09/30", numeric = FALSE)
x |
an object of class "Date" or "POSIXt." Missing values are permitted and result in corresponding missing values in the output. |
start.month |
a charcter string indicating the starting month of the season,
must match either the month name ( |
end.month |
a charcter string indicating the ending month of the season,
must match either the month name ( |
numeric |
a logical value that indicates whether the returned values
should be numeric |
start.day |
a character string of the form "mm/dd" indicating the starting day of the season.x |
end.day |
a character string of the form "mm/dd" indicating the last day of the season. Use "02/29" for the last day in February. |
The season year is allowed to overlap the calendar year, so the end.month
may precede the start.month
.
An ordered factor or numeric vector corresponding to the season of the year.
Input data values outside of the months specified are retruned as missing values
NA
.
For seasonYear
, the season year is defined as the period from the first day of the starting month
to the last day of the ending month. For seasonYearMD
, it is the
specified month and day for the beginning and ending of the period.
The season year is designated by the calendar year in which it ends. Thus, the season
year starting December 1, 1998 and ending March 30, 1999, is the "1999 December-March season year."
month.name
, month.abb
## Not run: library(smwrData) data(QW05078470) ## Return an ordered factor seasonYear(QW05078470$DATES) ## Should be the same seasonYearMD(QW05078470$DATES) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.