Creates an age grid according to a specified format

make_agegrid(
  grid = c("compact", "classic", "extensive", "0-104w", "0-24m", "0-21y"),
  unit = c("year", "month", "week", "day"),
  dec = 4L
)

Arguments

grid

A character string specifying one of the following: "compact", "classic", "extensive", "0-104w", "0-24m" and "0-21y". The default produces an age grid between 0 and 21 years with 95 points.

unit

Character string specifying the time unit. Choices are "year", "month", "week" and "day".

dec

Number of decimals for the result.

Value

Numeric vector or NULL

Author

Stef van Buuren, 2021

Examples

head(make_agegrid("classic"))
#> [1] 0.0000 0.0192 0.0383 0.0575 0.0767 0.0958