Skip to contents

When the dimension is defined as date type, using this function we can select the levels to include in it: day, week, month, quarter, semester and year.

Usage

select_date_levels(
  td,
  include_all,
  exclude_all,
  day_level,
  week_level,
  month_level,
  quarter_level,
  semester_level,
  year_level
)

# S3 method for when
select_date_levels(
  td,
  include_all = FALSE,
  exclude_all = FALSE,
  day_level = NULL,
  week_level = NULL,
  month_level = NULL,
  quarter_level = NULL,
  semester_level = NULL,
  year_level = NULL
)

Arguments

td

A when object.

include_all

A boolean, include all levels.

exclude_all

A boolean, exclude all levels.

day_level

A boolean, include day level.

week_level

A boolean, include week level.

month_level

A boolean, include month level.

quarter_level

A boolean, include quarter level.

semester_level

A boolean, include semester level.

year_level

A boolean, include year level.

Value

A when object.

Examples


td <- when() |>
  select_date_levels(week_level = FALSE)