Skip to contents

Using this function we can change the name assigned to the hours of the day to designate the parts of the day.

Usage

set_day_part(td, hour, name)

# S3 method for when
set_day_part(td, hour = NULL, name = NULL)

Arguments

td

A when object.

hour

A number, hour number (between 0 and 23).

name

a string, name of the part of the day.

Value

A when object.

Examples


td <- when() |>
  set_day_part(hour = c(21:23, 0:4), name = "Night")