Learn R Programming

ggenealogy (version 0.2.0)

plotPathOnAll: Plot a path between two vertices over the full genealogy

Description

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 year, 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.

Usage

plotPathOnAll(path, geneal, ig, binVector = sample(1:12, 12), edgeCol = "gray84", pathEdgeCol = "seagreen", nodeSize = 3, pathNodeSize = 3, pathNodeFont = "bold", nodeCol = "black", animate = FALSE)

Arguments

path
path as returned from getPath() or a vector of two variety names which exist in ig
geneal
the full genealogy (in data frame format)
ig
the graph representation of the data genealogy (in igraph format)
binVector
vector of numbers between 1 and length(binVector), each repeated exactly once
edgeCol
color of the non-path edges, default is "gray84"
pathEdgeCol
color of the path edges, default is "seagreen"
nodeSize
text size of the non-path node labels, default is 3
pathNodeSize
text size of the path node labels, default is 3
pathNodeFont
font face of text of the path node labels ("plain", "italic", "bold", "bold.italic"), default is "bold"
nodeCol
color of the non-path node labels, default is black
animate
If the plot will have interactive capabilities, default is FALSE

See Also

http://www.r-project.org for iGraph information

getPath for information on input path building

Examples

Run this code
data(sbGeneal)
ig <- dfToIG(sbGeneal)
path <- getPath("Brim", "Bedford", ig, sbGeneal)
bV <- sample(1:12, 12)
plotTotalImage <- plotPathOnAll(path = path, geneal = sbGeneal, ig = ig, binVector = bV)
plotTotalImage

Run the code above in your browser using DataLab