Description Usage Arguments Examples
This function returns the age of a given individual (with known birth date) at a given date.
1 |
x |
Individual ID |
evdat |
Dates of interest in the Year-month-day format (e.g. "1850-01-01") |
round.digits |
Number of digits for rounding (default is NA, i.e. no rounding) |
evmat |
A matrix for event data (see codelinkget_evmat) |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.