Produces a structured visualisation of the (average) number of each relationship
type per proband, based on the labelled pairwise relationship data from
label_relatives(). The plot arranges relationship types according to
generational distance and degree of relatedness, providing an intuitive overview
of kinship structure within the study sample.
Relation_per_proband_plot(
labelled_relations,
proband_vec,
reported_info = "both"
)A ggplot2 object showing the (mean) number of relatives per proband for each
relationship type. The plot can be further modified using standard
ggplot2 functions (e.g., + theme() or + labs()).
A tibble or data frame containing pairwise relationship labels and their associated metadata. Must include the following columns:
Identifier for the first individual (typically the proband).
Identifier for the second individual (the relative).
Number of generations separating each individual from their most recent common ancestor.
Kinship coefficient between the two individuals.
Relationship label assigned by label_relatives().
A vector of identifiers for probands. The function restricts
the analysis to pairs where id1 is included in this vector.
Chose which information is reported on the figure.
shows the total number of relatives of each type across all probands.
shows the average number of relatives of each type per proband.
(default) shows both total and average numbers on the plot.
If any relationship types in the input are not recognised in the predefined
mapping (e.g., rare or complex kinships), these are aggregated and shown as
"Other".
label_relatives() for generating the relationship labels used as input.
# see vignette on identifying and labelling relatives
Run the code above in your browser using DataLab