Description Usage Arguments Details Value Examples
View source: R/yearmon_helpers.R
ym_get_wateryear()
returns the water year (assumed to be October -
September) from a zoo::yearmon object.
1 2 3 | ym_get_wateryear(ym)
getWYFromYearmon(ym)
|
ym |
An object of class zoo::yearmon, or something that can be successfully converted to zoo::yearmon. |
If the argument is not already a yearmon object, it will attempt to convert
it to a zoo::yearmon. This may result in unexpected results. For example,
the string "12-1-1906"
can be converted to a zoo::yearmon, however, it
will not convert to "Dec 1906"
as you might desire. It will convert to
"Jan 0012"
since it is not a format expected by zoo::as.yearmon()
.
Therefore, a warning is posted when the function attempts to convert to
zoo::yearmon, and it is safer to ensure ym
is already a zoo::yearmon.
The water year as a numeric.
1 2 | ym_get_wateryear(zoo::as.yearmon(c("Dec 1906", "Oct 1945", "Jul 1955")))
ym_get_wateryear("2000-11")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.