get_year {dint}R Documentation

Get Year, Quarter, Month or Isoweek

Description

Get Year, Quarter, Month or Isoweek

Usage

get_year(x)

get_quarter(x)

get_month(x)

get_isoweek(x)

get_isoyear(x)

Arguments

x

a date_xx or any R object that can be coerced to POSIXlt

Details

If you use lubridate in addition to dint, you can also use lubridate::year(), lubridate::month() and lubridate::quarter() with dint objects.

Value

an integer vector.

See Also

lubridate::year(), lubridate::month(), lubridate::quarter()

Examples

x <- date_yq(2016, 2)
get_year(x)
## Not run: 
library(lubridate)
year(x)

## End(Not run)

x <- date_yq(2016, 2)
get_quarter(x)
## Not run: 
library(lubridate)
quarter(x)

## End(Not run)

x <- date_yq(2016, 2)
get_month(x)
## Not run: 
library(lubridate)
month(x)

## End(Not run)
x <- date_yw(2016, 2)
get_isoweek(x)

get_isoyear(as.Date("2018-01-01"))
get_isoyear(as.Date("2016-01-01"))

[Package dint version 2.1.4 Index]