sample_kh: Sample a Krummhörn mother

Description Usage Arguments Examples

Description

This function returns random draws of mother IDs from a selection of families being classified as 'fully documented'.

Usage

1
sample_kh(df_ind, df_fam, n = 1)

Arguments

df_ind

A dataframe

df_fam

A dataframe containing

n

Number of draws to perform. For n equal or larger the number of mothers in initial sample, the vector of all mother IDs is returned instead. Default is 1.

Examples

1
2
3
4
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")
sample_kh(df_ind, df_fam)

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