get_date: Returns a given individual's date of birth or death

Description Usage Arguments Examples

Description

This function returns the birth date of a given individual, if known.

Usage

1
2
get_date(x = NULL, df_ind = NULL, df_fam = NULL, var_id = "id",
  var_date = c("bdate", "ddate", "mdate")[1])

Arguments

x

Individual ID

df_ind

A dataframe containing IDs and birth dates

var_id

Variable name for ID (default is 'id')

var_date

Variable name for birth date (default is 'bdate')

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
df_ind <- get_exmpl_df()
df_ind$bdate <- sample(seq(as.Date("1774-12-31"), as.Date("1874-12-31"), 100), nrow(df_ind))
df_fam <- data.frame(idf = c(0,unique(df_ind$momid[df_ind$momid>0])), fall = "C")
evmat <- get_evmat(df_ind, df_fam)
my_id <- sample_kh(df_ind, df_fam)
get_age(my_id, paste(df_ind$bdate[df_ind$id == my_id]+21*365-25), evmat)

## End(Not run)

johow/kinlab documentation built on July 5, 2019, 4:23 p.m.