Making a kinship chart in R

Author: Elspeth Ready
Date: 2016/01/19

This example shows the kinship naming system among Inuit in Kangiqsujuaq, Nunavik, for male ego, based on data collected by Saladin d'Anglure (1967). Download the data for this example (a .csv file) here.

This R code produces this kinship diagram.

First, install the package kinship2 and load it.

library(kinship2) #load needed library

Next, import the kinship data. Data should be formatted with each person having a unique ID number, and there should be at least two additional columns for each row, one containing the father's ID number and the mother's ID number. Sex should be coded as 1 for male and 2 for female.

YWBkin <- read.csv("YWBkinnames.csv", header=TRUE)

Now, turn this data into a kinship object. I entered the variable consang (for "consanguineal kin") to mark the "affected" status of individuals. "Affected" individuals will have filled nodes in the diagram.

ped <- pedigree(YWBkin$id, dadid=YWBkin$fid, momid=YWBkin$mid, sex=YWBkin$sex, affected=YWBkin$consang)

Here I create a variable that I will use to re-colour the nodes in the graph. Remember that individuals marked as "affected" will have filled nodes, others won't.

kincolors <- YWBkin$consang+1 #use consanguinuity to color the nodes
kincolors[1] <- 1 #change the focal individual's color to highlight him/her

Finally, plot the diagram:

pdf("YWBmalekin.pdf", height=8, width=10, pointsize=6)
plot.pedigree(ped, id=YWBkin$name, col=kincolors, mar=c(1, 3, 7, 2)) #see ?plot.pedigree for options
mtext("Kangiqsujuarmiut male kinship terminology", side=3, cex=2, font=2) #add a title


Saladin d'Anglure, B. (1967). L'organisation sociale traditionnelle des esquimaux de Kangirsujuaaq. Centre d'Études Nordiques, Québec.