Learn R Programming

dttr2 (version 0.4.0)

dtt_set_time: Floor Time

Description

Coerces vectors to floored (and wrapped) hms vectors.

Usage

dtt_set_time(x, value)

dtt_time(x, ...)

dtt_time(x) <- value

# S3 method for integer dtt_time(x, ...)

# S3 method for double dtt_time(x, ...)

# S3 method for character dtt_time(x, ...)

# S3 method for Date dtt_time(x, ...)

# S3 method for hms dtt_time(x, ...)

# S3 method for POSIXct dtt_time(x, ...)

# S3 method for POSIXlt dtt_time(x, ...)

# S3 method for Date dtt_time(x) <- value

# S3 method for POSIXct dtt_time(x) <- value

Value

A floored hms vector.

Arguments

x

A vector.

value

A time vector.

...

Unused.

Methods (by class)

  • integer: Coerce integer vector to a floored hms vector

  • double: Coerce double vector to a floored hms vector

  • character: Coerce character vector to a floored hms vector

  • Date: Coerce Date vector to a floored hms vector

  • hms: Coerce hms vector to a floored hms vector

  • POSIXct: Coerce POSIXct vector to a floored hms vector

  • POSIXlt: Coerce POSIXlt vector to a floored hms vector

  • Date: Set time values for a Date vector

  • POSIXct: Set time values for a POSIXct vector

See Also

Other floor: dtt_date_time(), dtt_date(), dtt_floored(), dtt_floor()

Examples

Run this code
dtt_time(1L)
dtt_time(1.999)
dtt_time(-0.001)
dtt_time(Sys.Date())
dtt_time(as.POSIXct("2001-01-01 02:30:40"))
dtt_time(as.POSIXct("2001-01-01 02:30:40", tz = "Etc/GMT-8"))

Run the code above in your browser using DataLab