This class represents a CF calendar of 360 days per year, evenly divided over 12 months of 30 days. This calendar is obviously not compatible with the standard POSIXt calendar.
This calendar supports dates before year 1 and includes the year 0.
CFtime::CFCalendar -> CFCalendar360
new()Create a new CF calendar.
CFCalendar360$new(nm, definition)nmThe name of the calendar. This must be "360_day". This argument is superfluous but maintained to be consistent with the initialization methods of the parent and sibling classes.
definitionThe string that defines the units and the origin, as per the CF Metadata Conventions.
A new instance of this class.
valid_days()Indicate which of the supplied dates are valid.
CFCalendar360$valid_days(ymd)ymddata.frame with dates parsed into their parts in columns
year, month and day. Any other columns are disregarded.
Logical vector with the same length as argument ymd has rows
with TRUE for valid days and FALSE for invalid days, or NA where
the row in argument ymd has NA values.
month_days()Determine the number of days in the month of the calendar.
CFCalendar360$month_days(ymd = NULL)ymddata.frame with dates parsed into their parts in columns
year, month and day. Any other columns are disregarded.
A vector indicating the number of days in each month for the
dates supplied as argument ymd. If no dates are supplied, the number
of days per month for the calendar as a vector of length 12.
leap_year()Indicate which years are leap years.
CFCalendar360$leap_year(yr)yrInteger vector of years to test.
Logical vector with the same length as argument yr. Since this
calendar does not use leap days, all values will be FALSE, or NA
where argument yr is NA.
date2offset()Calculate difference in days between a data.frame of time
parts and the origin.
CFCalendar360$date2offset(x)xdata.frame. Dates to calculate the difference for.
Integer vector of a length equal to the number of rows in
argument x indicating the number of days between x and the origin,
or NA for rows in x with NA values.
offset2date()Calculate date parts from day differences from the origin. This only deals with days as these are impacted by the calendar. Hour-minute-second timestamp parts are handled in CFCalendar.
CFCalendar360$offset2date(x)xInteger vector of days to add to the origin.
A data.frame with columns 'year', 'month' and 'day' and as many
rows as the length of vector x.
clone()The objects of this class are cloneable with this method.
CFCalendar360$clone(deep = FALSE)deepWhether to make a deep clone.