IDch {Families}R Documentation

IDs of children of ego

Description

Retrieves IDs of children of ego(s).

Usage

IDch(idego, d = NULL, keep_ego = FALSE)

Arguments

idego

ID of ego(s). If the vector idego includes missing elements (NA), they are removed.

d

Name of database. If d is missing, the dataset dLH in the global environment (R workspace) is used. If no dLH in the global environment, the database dLH distributed with the Families package is used.

keep_ego

Logical variable. If TRUE, a dataframe of parent-child and father-child dyads is produced. It includes, for each ego (parent), ego's ID and the IDs of ego's children.

Value

Two cases:

Examples

# Load the data
data(dLH,package=("Families"))

IDch(idego=1)
set.seed(43)
id <- sample (dLH$ID[dLH$gen==1],10)
id2 <- IDch(idego=sort(id),keep_ego=TRUE)
id3 <- IDch(id2$idch,keep_ego=TRUE)



[Package Families version 2.0.2 Index]