decompose_date: Decompose a date into components

Description Usage Arguments Details Value

Description

TODO - better names for these functions

Usage

1
2
3
4
decompose_date(date, week_style = c("nam", "iso"), use_year = TRUE)

mutate_decompose_date(.data, date = .data$date, week_style = "nam",
  use_year = TRUE)

Arguments

date

Date, date to decompose

week_style

character, style to use: "nam", "iso"

use_year

logical, use year as a variable

.data

tbl_df to which to bind new columns

Details

One is used to operate on a vector, the other to operate on a data frame.

Talk about ISO weeks, talk about using years.

Value

decompose_date: tbl_df with variables:

.year

integer, year to which the week belongs

.week

integer, number of week

.wday

integer, identifies the day in the week

mutate_decompose_date(): .data, with additional columns generated using decompose_date()


ijlyttle/septimanr documentation built on May 28, 2019, 9:55 p.m.