dtt_hours {dttr2}R Documentation

Get and Set Hour Values

Description

Gets and sets hour values for date/time vectors.

Usage

dtt_hours(x, ...)

dtt_hours(x) <- value

dtt_hour(x, ...)

dtt_hour(x) <- value

## S3 method for class 'Date'
dtt_hour(x, ...)

## S3 method for class 'POSIXct'
dtt_hour(x, ...)

## S3 method for class 'hms'
dtt_hour(x, ...)

## S3 replacement method for class 'POSIXct'
dtt_hour(x) <- value

## S3 replacement method for class 'hms'
dtt_hour(x) <- value

dtt_set_hour(x, value)

Arguments

x

A date/time vector.

...

Unused.

value

A integer vector of the hour value(s).

Value

An integer vector (or the modified date/time vector).

Methods (by class)

Examples

x <- as.POSIXct("1990-01-02 23:40:51")
dtt_hour(x)
dtt_hour(x) <- 01L
x

x <- hms::as_hms("23:40:51")
dtt_hour(x)
dtt_hour(x) <- 01L
x

[Package dttr2 version 0.3.0 Index]