dtt_time_from_ints: Create Time from Vectors

View source: R/time-from-ints.R

dtt_time_from_intsR Documentation

Create Time from Vectors

Description

Pass vectors of hour, minute and second values to create a time object.

Usage

dtt_time_from_ints(hour = 0L, minute = 0L, second = 0L)

Arguments

hour

An integer of the hour between 0 and 23.The default value is hour zero.

minute

An integer of the minute between 0 to 59. The default value is minute zero.

second

An integer of the second between 0 to 59. The default value is second zero.

Details

This can be very helpful when needing to create a time column in a data frame from hour, minute and second columns. Vectors must all be the same length or be of length one.

Value

A floored hms vector.

See Also

Other creates: dtt_date_from_ints(), dtt_date_time_from_ints()

Examples

dtt_time_from_ints()

dtt_time_from_ints(
  hour = 10,
  minute = 15,
  second = 30
)

dtt_time_from_ints(
  hour = c(10, 11),
  minute = c(15, 15),
  second = c(30, 0)
)

hour <- c(9, 10, 11)
minute <- c(15, 30, 45)
second <- 0
dtt_time_from_ints(hour, minute, second)

dttr2 documentation built on Sept. 26, 2024, 1:06 a.m.