Learn R Programming

qtl2pleio (version 1.4.3)

subset_kinship: Subset a kinship matrix to include only those subjects present in all inputs

Description

Since a kinship matrix has subject ids in both rownames and colnames, so we need to remove rows and columns according to names in `id2keep`. We first remove rows and columns of subjects that are not in `id2keep`. We then order rows and columns of the resulting matrix by the ordering in `id2keep`.

Usage

subset_kinship(kinship, id2keep)

Arguments

kinship

a kinship matrix

id2keep

a character vector of subject ids to identify those subjects that are shared by all inputs