View source: R/Labelling_and_plotting_functions.R
| Relation_per_proband_plot | R Documentation |
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"
)
labelled_relations |
A tibble or data frame containing pairwise relationship labels and their associated metadata. Must include the following columns:
|
proband_vec |
A vector of identifiers for probands. The function restricts
the analysis to pairs where |
reported_info |
Chose which information is reported on the figure.
|
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".
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()).
label_relatives() for generating the relationship labels used as input.
# see vignette on identifying and labelling relatives
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.