utIsTime {udunits}R Documentation

Determines if Unit is Temporal

Description

Determines whether the unit is temporal (i.e., has units of time).

Usage

 utIsTime( unit )

Arguments

unit A unit, in internal format as returned by utScan() or as a human-readable string.

Details

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).

Value

TRUE if the unit has units of time, and FALSE otherwise.

Note

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().

Author(s)

Library routines by Unidata; interface glue by David W. Pierce dpierce@ucsd.edu

References

http://www.unidata.ucar.edu/packages/udunits/

See Also

utInit, utScan, utCalendar, utInvCalendar, utFormatDate, utDayOfWeek, utHasOrigin, utConvert

Examples

# 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")

[Package udunits version 1.3 Index]