Learn R Programming

descsuppR (version 1.2)

as.tod: Conversion to and from 'Time of Day'

Description

Does not safeguard against "26:69".

Usage

as.tod(x)

# S3 method for character as.tod(x)

# S3 method for circular as.tod(x)

is.tod(x)

# S3 method for tod as.double(x, ...)

circular(x, ...)

# S3 method for default circular( x, type = c("angles", "directions"), units = c("radians", "degrees", "hours"), template = c("none", "geographics", "clock12", "clock24"), modulo = c("asis", "2pi", "pi"), zero = 0, rotation = c("counter", "clock"), names = NULL, ... )

# S3 method for tod circular(x, ...)

Value

x converted to/from 'tod'

Arguments

x

An object to be converted to or represented as a circular object.

...

Additional arguments passed to methods or lower-level functions.

type

Character string indicating if data represent "angles" or "directions".

units

Character string; the measurement units for the input data ("radians", "degrees", or "hours").

template

Character string specifying a specific template for circular data.

modulo

Character string indicating the modulo arithmetic to be used ("asis", "2pi", "pi").

zero

Numeric; direction assigned as zero (in the specified units).

rotation

Character string; direction of rotation for increasing values ("counter", "clock").

names

Optional character vector of names for the object.

Author

Dr. Andreas Leha

Examples

Run this code
times <- c("8:53", NA, "22:30")

## some conversions
as.tod(times)
as.numeric(as.tod(times))

is.tod(times)
is.tod(as.tod(times))

Run the code above in your browser using DataLab