dtt_months {dttr2}R Documentation

Get and Set Month Values

Description

Gets and sets month values for date/time vectors.

Usage

dtt_months(x, ...)

dtt_months(x) <- value

dtt_month(x, ...)

dtt_month(x) <- value

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

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

## S3 replacement method for class 'Date'
dtt_month(x) <- value

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

dtt_set_month(x, value)

Arguments

x

A date/time vector.

...

Unused.

value

A integer vector of the month value(s).

Value

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

Methods (by class)

Examples

x <- as.Date("1990-01-02")
dtt_month(x)
dtt_month(x) <- 11L
x

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

[Package dttr2 version 0.3.0 Index]