This function automatically generates alignment hints for pedigree plotting. Hints control the relative horizontal positioning of subjects within their generation and the placement of spouse pairs. The function handles twins, multiple marriages, and complex pedigree structures. It is a somewhat optimized version of kinship2's autohint.
kinship2_autohint(ped, hints, packed = TRUE, align = FALSE)A list containing:
Numeric vector of relative ordering hints for subjects
Matrix of spouse pair information
A pedigree object
Optional existing hints (list with `order` and optionally `spouse` components)
Logical, if TRUE uses compact packing algorithm (default TRUE)
Logical, if TRUE attempts to align spouses on the same level (default FALSE)
The function is called automatically by kinship2_align.pedigree if no hints are provided. It analyzes the pedigree structure, identifies twins, handles multiple marriages, and determines optimal subject ordering to minimize crossing lines and produce aesthetically pleasing plots.
Full documentation is available in the align_code_details vignette.