# Load the red squirrels datasets
data(redsquirrels)
data(redsquirrels_full)
# View the structure of the dataset(s)
str(redsquirrels)
str(redsquirrels_full)
# Plot a pedigree for a single family
if (requireNamespace("ggplot2", quietly = TRUE)) {
# Select one family to plot
family_data <- subset(redsquirrels, famID == 160)
# Create a pedigree plot
ggPedigree(family_data,
personID = "personID",
momID = "momID",
dadID = "dadID",
sex = "sex",
config = list(
add_phantoms = TRUE,
code_male = "M"
)
)
}
Run the code above in your browser using DataLab