Learn R Programming

Families (version 2.0.2)

IDsib: IDs of siblings of ego

Description

Retrieves IDs of siblings of ego

Usage

IDsib(idego, d = NULL)

Value

A list vector of two elements.

  • dfsib: dataframe of IDs of ego-sibling dyads.

  • id: vector of IDs of siblings.

Returns NA if ID of sibling cannot be computed because the ID of mother is not included in the database.

Arguments

idego

ID of ego

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.

Examples

Run this code
# Load data
data(dLH,package="Families")
# IDs of siblings of single member of generation 3
set.seed(34)
idego <- sample(dLH$ID[dLH$gen==3],1)
idsib <- IDsib (idego)

# For each member of generation 2, IDs of siblings
idego <- dLH$ID[dLH$gen==2]
idsib <- IDsib(idego)

Run the code above in your browser using DataLab