plot_gg_path | R Documentation |
ggenealogy
Plots a shortest path between two mathematicians in a genealogical tree using the ggenealogy
layout engine.
plot_gg_path(g, id1 = NULL, id2 = NULL, expand = 0.15)
g |
an object of class |
id1 |
an |
id2 |
an |
expand |
a |
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.
The shortest path between the two mathematician IDs provided is plotted, with the x
position of each label determined by the year of PhD award.
NOTE: if the name of the nearest common ancestor is long, it can be clipped by ggplot2
.
If this occurs, increase the expand
argument greater than the default of 0.15
.
An object of class ("gg", "ggplot")
which can be displayed, or further manipulated using additional layers or aesthetic modifications from the ggplot2
package.
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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v089.i13")}.
Wickham, H. (2016). ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York.
# 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.
# For example, to find the shortest genealogical path between the package
# author and my former postdoc supervisor, I would start by querying using
# both mathematician IDs
g <- get_genealogy(c(96119, 171971))
# Then use the plot_gg_path() function to use the underlying ggenealogy package
plot_gg_path(g)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.