This is an internal helper function for pedigree alignment. It takes two previously aligned pedigree structures (x1 and x2) and merges them side-by-side, handling overlapping subjects and adjusting positions appropriately.
kinship2_alignped3(x1, x2, packed, space = 1)A list containing the merged pedigree structure:
Vector of counts per level
Matrix of subject IDs at each level and position
Matrix of horizontal positions
Matrix of family indices
First aligned pedigree structure (list)
Second aligned pedigree structure (list)
Logical, if TRUE uses compact packing; if FALSE adds spacing
Numeric, horizontal spacing between structures when packed=FALSE (default 1)