Prepare data for ggPhenotypeByDegree This function prepares the data frame for plotting by calculating necessary columns and ensuring required columns are present.
.preparePhenotypeByDegreeData(
df,
y_var,
y_se = NULL,
y_stem_se = NULL,
y_ci_lb = NULL,
y_ci_ub = NULL,
config = list()
)
A modified data frame with additional columns for plotting.
Data frame containing pairwise summary statistics. Required columns:
Minimum relatedness per group
Maximum relatedness per group
Number of pairs at that relatedness
Indicator for shared nuclear environment (1 = yes, 0 = no)
Indicator for shared mitochondrial DNA (1 = yes, 0 = no)
Name of the y-axis variable column (e.g., "r_pheno_rho").
Name of the standard error column (e.g., "r_pheno_se").
Optional; base stem used to construct SE ribbon bounds. (e.g., "r_pheno")
Optional; lower bound for confidence interval (e.g., "r_pheno_ci_lb").
Optional; upper bound for confidence interval (e.g., "r_pheno_ci_ub").
A list of configuration overrides. Valid entries include:
Minimum number of pairs to include (default: 500)
Minimum degree of relatedness (default: 0)
Maximum degree of relatedness (default: 7)
Plot title
Plot subtitle
Paletteer color scale name (e.g., "ggthemes::calc")
If TRUE, only classic kin are shown
If TRUE, use classic kin × mtDNA for grouping
If TRUE, remove classic kin rows
If TRUE, remove non-classic sibs (default: TRUE)
If TRUE, annotate mother/father/sibling points
Relative x-axis shift for annotations
Relative y-axis shift for annotations
Size of geom_point points (default: 1)
If TRUE, x-axis uses degree-of-relatedness scaling
Grouping column name (default: mtdna_factor)
Number of decimal places for rounding (default: 2)
Tolerance % for matching known degrees
Maximum number of degrees to consider