plot_gg {maths.genealogy} | R Documentation |
Plot genealogical tree with ggenealogy
Description
Plots a genealogical tree using the ggenealogy
layout engine.
Usage
plot_gg(g, max_anc = 3L, max_des = 3L, id = NULL, col = "red", expand = 0.15)
Arguments
g |
an object of class |
max_anc |
an |
max_des |
an |
id |
an |
col |
a |
expand |
a |
Details
This function requires the ggenealogy
package to be installed.
It is only a "Suggests" dependency because this package supports multiple plotting approaches.
The presence of this package will be verified when the function is actually called, providing an opportunity to install automatically if needed.
This function is not suitable for plotting very large whole genealogical trees.
Consider using plot_grviz()
if you want to see an entire tree.
Value
An object of class ("gg", "ggplot")
which can be displayed, or further manipulated using additional layers or aesthetic modifications from the ggplot2
package.
References
Rutter, L., VanderPlas, S., Cook, D. and Graham, M.A. (2019). “ggenealogy: An R Package for Visualizing Genealogical Data”, Journal of Statistical Software, 89(13), 1-31. doi:10.18637/jss.v089.i13.
Wickham, H. (2016). ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York.
Examples
# First, you need to use search_id() to find the mathematician ID for the
# individual(s) you wish to plot, or visit https://mathgenealogy.org/ to look
# up in the browser.
# Don't test these as rely on internet resources that can be temporarily
# unavailable.
# For example, the package author would get their own tree using
g <- get_genealogy(171971)
# Then use the plot_gg() function to use the underlying ggenealogy package
plot_gg(g)