IDgch {Families}R Documentation

IDs of grandchildren of ego

Description

Retrieves ID of grandchildren of ego or vector of egos

Usage

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

Arguments

idego

ID of ego(s)

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

If keep_ego=TRUE, parent-child-grandchild triads are shown.

Value

Two cases:

Examples


# Load data
data(dLH,package="Families")
IDch(IDch(dLH$ID[dLH$sex=="Female" & dLH$gen==1]))[1]

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


[Package Families version 2.0.2 Index]