Skip to contents

Each attribute is defined by a function that adds a column to a table based on the parameter that contains the date or time. This function sets the definition function for the attribute whose name is given.

Usage

set_attribute_definition_function(td, name, f)

# S3 method for when
set_attribute_definition_function(td, name = NULL, f = NULL)

Arguments

td

A when object.

name

A string, attribute name.

f

A function.

Value

A when object.

Examples


f <- function(table, values, ...) {
  table[['year']] <- 'Not defined'
  table
}

wd <- when() |>
  set_attribute_definition_function(name = "year", f)