CFCalendarNone | R Documentation |
This class represents a CF calendar with no annual cycle. All datetimes in the calendar are the same. This is useful only for repeated experiments simulating a fixed time in the year.
CFtime::CFCalendar
-> CFCalendarNone
new()
Create a new CF calendar.
CFCalendarNone$new(nm, definition)
nm
The name of the calendar. This must be "none". This argument is superfluous but maintained to be consistent with the initialization methods of the parent and sibling classes.
definition
The 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. In this calendar only one date is valid, namely the one that the calendar is initialized with.
CFCalendarNone$valid_days(ymd)
ymd
data.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.
This always returns a vector of NA
values because this method has no
meaning for this class.
CFCalendarNone$month_days(ymd = NULL)
ymd
data.frame
with dates parsed into their parts in columns
year
, month
and day
. Any other columns are disregarded.
A vector with NA
values for the dates supplied as argument
ymd
. If no dates are supplied, a vector of NA
values of length 12.
leap_year()
Indicate which years are leap years. This always returns a
vector of NA
values because this method has no meaning for this
class.
CFCalendarNone$leap_year(yr)
yr
Integer vector of years to test.
Vector with the same length as argument yr
with NA
values.
date2offset()
Calculate difference in days between a data.frame
of time
parts and the origin. The difference is always 0, given that
this is not a true calendar and there can be no calculations to
determine any difference.
CFCalendarNone$date2offset(x)
x
data.frame
. Dates to calculate the difference for.
Integer vector of a length equal to the number of rows in
argument x
indicating 0 for the days that equal the origin
of the calendar, or NA
otherwise.
offset2date()
Calculate date parts from day differences from the origin. This always returns 0's for the year, month and day as other values are not valid in this calendar. Hour-minute-second datetime parts are handled in CFCalendar.
CFCalendarNone$offset2date(x)
x
Integer 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
. Rows with values of x
other than 0
will return the values for the origin of the calendar nonetheless, in
accordance with the CF Metadata Conventions.
clone()
The objects of this class are cloneable with this method.
CFCalendarNone$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.