Skip to contents

Adds a logical column indicating whether each row falls within the specified ISO years. Typically used to restrict analysis to a calendar period.

Usage

skeleton_eligible_isoyears(dt, isoyears, col_name = "eligible_isoyears")

Arguments

dt

A data.table with an `isoyear` column.

isoyears

Integer vector of eligible ISO years (e.g., 2007:2020).

col_name

Character. Name of the eligibility column to create. Default: "eligible_isoyears".

Value

The input data.table (invisibly), modified by reference with the new eligibility column.

Examples

if (FALSE) { # \dontrun{
temp |>
  skeleton_eligible_isoyears(2007:2020)
} # }