# A sample pedigree data frame with only the three mandatory columns.
ped <- data.frame(ID = 1:7, SIRE = c(0, 0, 1, 0, 3, 0, 5), DAM = c(0, 0, 2, 2, 4, 0, 6))
# Example 1: A pedigree Mermaid syntax without customizations.
x <- mermaid_md(ped)
# Read the "Value" part about displaying the output on-screen and writing it into a file.
# Example 2: Repeat example 1. Change arrow links to lines and the orientation to horizontal.
x <- mermaid_md(ped, orient = "LR", type = "line")
# Example 3: Repeat example 1. Pink background and round border edges for females (2, 4, 6).
ped$BgColor <- c(NA, "pink", NA, "pink", NA, "pink", NA)
ped$RoundBorder <- c(NA, "Y", NA, "Y", NA, "Y", NA)
x <- mermaid_md(ped)
# Example 4: Repeat example 3. Ticker border line for individuals in the control group (2, 5, 7).
ped$lwd <- c(1, 3, 1, 1, 3, 1, 3)
x <- mermaid_md(ped)
# Example 5: Use the default value and NA alternatively. This is not different from example 4.
ped$lwd <- c(NA, 3, NA, NA, 3, NA, 3)
x <- mermaid_md(ped)
# Example 6: Repeat example 1. Change link curve to "step" and green dashed.
x <- mermaid_md(ped[, c("ID", "SIRE", "DAM")],
curve = "step", color = "#00FF00", dash = "Y")
Run the code above in your browser using DataLab