This function requires a path and the ig object, and plots the full genealogy with the path highlighted. The image will correctly position the node labels with x-axis representing the node date, and y-axis representing the node path index. Light grey edges between two nodes represent parent-child relationships between those nodes. To enhance the visual understanding of how the path-of-interest fits into the entire graph structure, the nodes within the path are labelled in boldface, and connected with light-green boldfaced edges.
plotPathOnAll(
path,
geneal,
ig,
colName,
colNameY = "",
bin = 12,
edgeCol = "gray84",
pathEdgeCol = "seagreen",
nodeSize = 3,
pathNodeSize = 3,
pathNodeFont = "bold",
nodeCol = "black",
animate = FALSE
)
path as returned from getPath() or a vector of two variety names which exist in ig
the full genealogy (in data frame format)
the graph representation of the data genealogy (in igraph format)
the name of the column of the data frame that contains the quantitative variable of interest (in character string format)
the name of the second optional column of the data frame that contains the second optional quantitative variable of interest (in character string format). This optional quantitative variable will be plotted on the vertical axis.
the number of bins to determine the vertical positions of nodes (default is 12). For more information on choosing bin size, please visit the ggenealogy vignette
color of the non-path edges, default is "gray84"
color of the path edges, default is "seagreen"
text size of the non-path node labels, default is 3
text size of the path node labels, default is 3
font face of text of the path node labels ("plain", "italic", "bold", "bold.italic"), default is "bold"
color of the non-path node labels, default is black
if the plot will have interactive capabilities, default is FALSE
Rutter L, VanderPlas S, Cook D, Graham MA (2019). ggenealogy: An R Package for Visualizing Genealogical Data. Journal of Statistical Software, 89(13), 1--31. tools:::Rd_expr_doi("10.18637/jss.v089.i13")
https://www.r-project.org for iGraph information
getPath
for information on input path building
data(sbGeneal)
sb <- sbGeneal[complete.cases(sbGeneal[1:3]),]
ig <- dfToIG(sb)
pathCL <- getPath("Clark", "Lawrence", ig, sb, "yield")
plotPathOnAll(pathCL, sb, ig, "yield", bin = 3, pathEdgeCol = "red") + ggplot2::xlab("Yield")
plotPathOnAll(pathCL, sb, ig, "yield", "devYear") + ggplot2::xlab("Yield") + ggplot2::ylab("Year")
Run the code above in your browser using DataLab