utIsTime {udunits} | R Documentation |
Determines whether the unit is temporal (i.e., has units of time).
utIsTime( unit )
unit |
A unit, in internal format as returned by utScan() or as a human-readable string. |
This routine determines whether a unit has units of only time. If it does, the routine returns TRUE, and returns FALSE otherwise. The passed argument can be either an internally-formatted units structure created by utScan(), or a human-readable units string (in which case this routine passes the string to utScan() itself).
TRUE if the unit has units of time, and FALSE otherwise.
To be a calendar, it is necessary but not sufficient for a unit string to be temporal. It must also have an origin. See utHasOrigin().
Library routines by Unidata; interface glue by David W. Pierce dpierce@ucsd.edu
http://www.unidata.ucar.edu/packages/udunits/
utInit
, utScan
,
utCalendar
, utInvCalendar
,
utFormatDate
, utDayOfWeek
,
utHasOrigin
, utConvert
# Initialize the udunits library utInit() # Set our calendar units unitstring <- "days since 1900-01-01" u <- utScan(unitstring) print(paste("Unit string",unitstring,"is temporal:",utIsTime(u))) # Here is another way of doing it: utIsTime("meters")