transform_age: Age Transforming Function

Description Usage Arguments Value Examples

View source: R/preprocessing.R

Description

Age Transforming Function

Usage

1
transform_age(age, type = "days", to = "years")

Arguments

age

a numeric vector with ages

type

type of the age vector, allowed values are days or years. defaults to 'days'

to

final format of age vector. allowed values are 'years', 'days', 'pw-N', and 'lg-N', where N is any number. 'pw' means power. e.g. pw-0.5 means sqrt(age), and 'lg' means log, e.g. lg-2 means log2(age). Defaults to 'years'.

Value

a vector with ages in the desired scale

Examples

1
2
3
4
agevec <- seq(1:20)
transform_age(agevec, type = 'years', to = 'days')
transform_age(agevec, type = 'years', to = 'pw-0.25')
transform_age(agevec, type = 'years', to = 'lg-10')

mdonertas/hetAge documentation built on Jan. 2, 2020, 12:53 a.m.