month_days {CFtime}  R Documentation 
Return the number of days in a month given a certain CF calendar
Description
Given a vector of dates as strings in ISO 8601 or UDUNITS format and a CFtime
object,
this function will return a vector of the same length as the dates,
indicating the number of days in the month according to the calendar
specification. If no vector of days is supplied, the function will return an
integer vector of length 12 with the number of days for each month of the
calendar (disregarding the leap day for standard
and julian
calendars).
Usage
month_days(cf, x = NULL)
Arguments
cf 
CFtime. The CFtime definition to use. 
x 
character. An optional vector of dates as strings with format

Value
A vector indicating the number of days in each month for the vector
of dates supplied as a parameter to the function. If no dates are supplied,
the number of days per month for the calendar as a vector of length 12.
Invalidly specified dates will result in an NA
value.
See Also
When working with factors generated by CFfactor()
, it is usually
better to use CFfactor_units()
as that will consider leap days for
nonepoch factors. CFfactor_units()
can also work with other time periods
and datum units, such as "hours per month", or "days per season".
Examples
dates < c("20211127", "20211210", "20220114", "20220218")
cf < CFtime("days since 18500101", "standard")
month_days(cf, dates)
cf < CFtime("days since 18500101", "360_day")
month_days(cf, dates)
cf < CFtime("days since 18500101", "all_leap")
month_days(cf, dates)
month_days(cf)