Skip to contents

When the dimension is defined as a time type, using this function we can select the level and its attributes to include in it: time, minute, second and day_part.

Usage

select_time_level(td, include_all, exclude_all, time, minute, second, day_part)

# S3 method for when
select_time_level(
  td,
  include_all = FALSE,
  exclude_all = FALSE,
  time = NULL,
  minute = NULL,
  second = NULL,
  day_part = NULL
)

Arguments

td

A when object.

include_all

A boolean, include all fields of the level.

exclude_all

A boolean, exclude all fields of the level.

time

A boolean, include a field for the time.

minute

A boolean, include the minute level of detail.

second

A boolean, include the second level of detail.

day_part

A boolean, include the parts of the day.

Value

A when object.

Details

The 'hour' attribute will always be included. If the 'minute' attribute is not included the 'second' attribute will not be included either.

Examples


td <- when() |>
  select_time_level(day_part = FALSE)