Extracts and modifies the x and y positions for each individual in a pedigree data frame using the align.pedigree function from the `kinship2` package. It returns a data.frame with positions for plotting.
calculateCoordinates(
ped,
personID = "personID",
momID = "momID",
dadID = "dadID",
spouseID = "spouseID",
sexVar = "sex",
twinID = "twinID",
code_male = NULL,
config = list()
)
A data frame with one or more rows per person, each containing:
`x_order`, `y_order`: Grid indices representing layout rows and columns.
`x_pos`, `y_pos`: Continuous coordinate positions used for plotting.
`nid`: Internal numeric identifier for layout mapping.
`extra`: Logical flag indicating whether this row is a secondary appearance.
A data frame containing the pedigree data. Needs personID, momID, and dadID columns
Character string specifying the column name for individual IDs. Defaults to "personID".
Character string specifying the column name for mother IDs. Defaults to "momID".
Character string specifying the column name for father IDs. Defaults to "dadID".
Character. Name of the column in `ped` for the spouse ID variable.
Character. Name of the column in `ped` for the sex variable.
Character string specifying the column name for twin IDs. Defaults to "twinID".
Value used to indicate male sex. Defaults to NULL.
List of configuration options:
Default is 1. Used by BGmisc::recodeSex().
Logical, default TRUE. Passed to `kinship2::align.pedigree`.
Logical, default TRUE. Align generations.
Numeric, default 15. Controls spacing.