Title: | Visualization Tools for Genealogical Data |
---|---|
Description: | Methods for searching through genealogical data and displaying the results. Plotting algorithms assist with data exploration and publication-quality image generation. Includes interactive genealogy visualization tools. Provides parsing and calculation methods for variables in descendant branches of interest. Uses the Grammar of Graphics. |
Authors: | Lindsay Rutter, Susan Vanderplas, Di Cook |
Maintainer: | Lindsay Rutter <[email protected]> |
License: | GPL |
Version: | 1.0.3 |
Built: | 2024-10-31 19:56:35 UTC |
Source: | CRAN |
Calculates coordinates to plot each ancestors and descendant of a variety in a lineage. The x and y values describe the coordinates of the label, while the xstart, ystart, xend, and yend values describe the edges of the label.
buildAncDesCoordDF(df)
buildAncDesCoordDF(df)
df |
the data frame of the ancestors and descendants of a variety (from function buildAncDesTotalDF) |
buildAncList
for information on determining ancestors
buildDesList
for information on determining descendants
Returns the data frame that includes labels and plot coordinates of all ancestors and descendants of a variety. Users can specify the maximum number of ancestors and descendants to display.
buildAncDesTotalDF(v1, geneal, mAnc = 3, mDes = 3)
buildAncDesTotalDF(v1, geneal, mAnc = 3, mDes = 3)
v1 |
the label of the vertex of interest (in character string format) |
geneal |
the full genealogy (in data frame format) |
mAnc |
the maximum number of generations of ancestors of v1 to be displayed (in numeric format) |
mDes |
the maximum number of generations of descendants of v1 to be displayed (in numeric format) |
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. doi:10.18637/jss.v089.i13
buildAncList
for information on determining ancestors
buildDesList
for information on determining descendants
data(sbGeneal) v1 <- "Essex" buildAncDesTotalDF(v1, sbGeneal)
data(sbGeneal) v1 <- "Essex" buildAncDesTotalDF(v1, sbGeneal)
This function returns a nested list of the ancestors of the inputted variety.
buildAncList(v1, geneal, gen = 0)
buildAncList(v1, geneal, gen = 0)
v1 |
the label of the vertex of interest (in character string format) |
geneal |
the full genealogy (in data frame format) |
gen |
the generation (note: This should be left as default, as any other input will not affect results anyway) |
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. doi:10.18637/jss.v089.i13
getParent
for information on determining parents
data(sbGeneal) getParent("Essex", sbGeneal) buildAncList("Essex", sbGeneal)
data(sbGeneal) getParent("Essex", sbGeneal) buildAncList("Essex", sbGeneal)
This function returns a nested list of the descendants of the inputted variety.
buildDesList(v1, geneal, gen = 0)
buildDesList(v1, geneal, gen = 0)
v1 |
the label of the vertex of interest (in character string format) |
geneal |
the full genealogy (in data frame format) |
gen |
the generation (note: This should be left as default, as any other input will not affect results) |
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. doi:10.18637/jss.v089.i13
getChild
for information on determining children
data(sbGeneal) getParent("Essex", sbGeneal) buildDesList("Essex", sbGeneal, 3)
data(sbGeneal) getParent("Essex", sbGeneal) buildDesList("Essex", sbGeneal, 3)
This function takes the graph object and creates a data frame object of the edges between all parent-child relationships in the graph.
buildEdgeTotalDF(geneal, ig, colName, bin = 12)
buildEdgeTotalDF(geneal, ig, colName, bin = 12)
geneal |
the full genealogy (in data frame format) |
ig |
the graph representation of the data genealogy (in igraph format) |
colName |
the name of the column of the data frame that contains the quantitative variable of interest (in character string format) |
bin |
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. |
dfToIG
for information on producing ig from the genealogy
https://www.r-project.org for iGraph information
This function takes the spreadTotalDF object (from the buildSpreadTotalDF function) and the path object as inputs. From these objects, it creates a data frame object of the label, x, and y values of all nodes in the ful genealogy. However, the data frame object does not include the labels of the path varieties, as they will be treated differently.
buildMinusPathDF(path, geneal, ig, colName, colNameY, bin = 12)
buildMinusPathDF(path, geneal, ig, colName, colNameY, bin = 12)
path |
path as returned from getPath() or a vector of two variety names which exist in the ig object |
geneal |
the full genealogy (in data frame format) |
ig |
the graph representation of the data genealogy (in igraph format) |
colName |
the name of the column of the data frame that contains the quantitative variable of interest (in character string format) |
colNameY |
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. |
bin |
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. |
https://www.r-project.org for iGraph information
getPath
for information on input path building
This function builds a dataframe of information about the path object that can later be used for visualization. The dataframe includes "label" (name of each variety) of each node, "x" (the date of the variety, the x-axis value for which the label and incoming/outgoing edges are centered), "y" (the y-axis value, which is the index of the path, incremented by unity), "xstart" (the x-axis position of the outgoing edge (leaving to connect to the node at the next largest y-value)), "xend" (the x-axis position of the outgoing edge (connected to the node at the next largest y-value)), "ystart" (the y-axis position of the outgoing edge (leaving to connect to the node at the next largest y-value), "yend" (the y-axis position of the outgoing edge (connected to the node at the next largest y-value))).
buildPathDF(path, geneal, colName, colNameY = "")
buildPathDF(path, geneal, colName, colNameY = "")
path |
path object representing the path between two vertices |
geneal |
the full genealogy (in data frame format) |
colName |
the name of the column of the data frame that contains the quantitative variable of interest (in character string format) |
colNameY |
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. |
This function takes the spreadTotalDF object (from the buildSpreadTotalDF function) and the path object as inputs. From these objects, it creates a data frame object of the text label positions for the varieties in the path, as well as the edges only in the varieties in the path.
buildPlotTotalDF(path, geneal, ig, colName, colNameY = "", bin = 12)
buildPlotTotalDF(path, geneal, ig, colName, colNameY = "", bin = 12)
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) |
colName |
the name of the column of the data frame that contains the quantitative variable of interest (in character string format) |
colNameY |
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. |
bin |
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 |
https://www.r-project.org for iGraph information
https://www.r-project.org for iGraph information
getPath
for information on input path building
Constructs a data frame object so that varieties are spread such that they do not overlap, even though the x-axis position will represent dates.
buildSpreadTotalDF(geneal, ig, colName, bin = 12)
buildSpreadTotalDF(geneal, ig, colName, bin = 12)
geneal |
the full genealogy (in data frame format) |
ig |
the graph representation of the data genealogy (in igraph format) |
colName |
the name of the column of the data frame that contains the quantitative variable of interest (in character string format) |
bin |
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 |
https://www.r-project.org for iGraph information
Processes the genealogy into an igraph object with appropriate vertex information, graph type, and edge weights.
dfToIG(geneal, vertexinfo = NULL, edgeweights = 1, isDirected = FALSE)
dfToIG(geneal, vertexinfo = NULL, edgeweights = 1, isDirected = FALSE)
geneal |
the full genealogy (in data frame format) |
vertexinfo |
(default NULL) either names of columns in the genealogy which should be added to the database as vertex information or a data frame with information for all vertices such that the first column contains vertex names. |
edgeweights |
(default 1) name of a column which contains edge weights |
isDirected |
(default FALSE) should the graph be a directed graph? |
https://www.r-project.org for iGraph information
This function returns a list of the ancestors of the inputted variety within and including a given number of generations
getAncestors(v1, geneal, gen = 3)
getAncestors(v1, geneal, gen = 3)
v1 |
the label of the vertex of interest (in character string format) |
geneal |
the full genealogy (in data frame format) |
gen |
the number of generations back to include as ancestors |
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. doi:10.18637/jss.v089.i13
data(sbGeneal) getParent("Essex", sbGeneal) getAncestors("Essex", sbGeneal, 1) getAncestors("Essex", sbGeneal, 5)
data(sbGeneal) getParent("Essex", sbGeneal) getAncestors("Essex", sbGeneal, 1) getAncestors("Essex", sbGeneal, 5)
Returns basic statistics of the graph object (number of nodes, number of edges, whether or not the whole graph is connected, number of components, average path length, graph diameter, etc.)
getBasicStatistics(ig)
getBasicStatistics(ig)
ig |
the graph representation of the data genealogy (in igraph format) |
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. doi:10.18637/jss.v089.i13
data(sbGeneal) ig <- dfToIG(sbGeneal) getBasicStatistics(ig)
data(sbGeneal) ig <- dfToIG(sbGeneal) getBasicStatistics(ig)
Returns a data frame containing the names of all children of an individual of interest ("Name"). The mean and standard deviation ("Mean" and "SD") of a quantitative variable across all descendents of each child is reported. In addition, for each child, the number of its descendants is reported ("Count"), the number of its descendants who do not have a value for the quantitative variable ("NACount") is reported, and the names of all of its descendants is reported ("DesNames").
getBranchQual(v1, geneal, colName, rExpr, gen = 3)
getBranchQual(v1, geneal, colName, rExpr, gen = 3)
v1 |
the label of the vertex of interest (in character string format) |
geneal |
the full genealogy (in data frame format) |
colName |
the name of the column of the data frame that contains the qualitative variable of interest (in character string format) |
rExpr |
regular expression to be applied to the column that contains the qualitative variable of interest (in character string format). The regular expression syntax must work on a data frame column of type character. The term geneal$colName must be used in the regular expression. |
gen |
the number of generations back to include as ancestors |
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. doi:10.18637/jss.v089.i13
data(statGeneal) rExpr = "geneal$colName=='The Johns Hopkins University'" DC_JHU = getBranchQual("David Cox", statGeneal, "school", rExpr, 15) rExpr = "geneal$colName=='UnitedKingdom'" DC_UK = getBranchQual("David Cox", statGeneal, "country", rExpr, 15) rExpr = "grepl('(?i)Stochastic', geneal$colName)" DC_Stochastic = getBranchQual("David Cox", statGeneal, "thesis", rExpr, 15)
data(statGeneal) rExpr = "geneal$colName=='The Johns Hopkins University'" DC_JHU = getBranchQual("David Cox", statGeneal, "school", rExpr, 15) rExpr = "geneal$colName=='UnitedKingdom'" DC_UK = getBranchQual("David Cox", statGeneal, "country", rExpr, 15) rExpr = "grepl('(?i)Stochastic', geneal$colName)" DC_Stochastic = getBranchQual("David Cox", statGeneal, "thesis", rExpr, 15)
Returns a data frame containing the names of all children of an individual of interest ("Name"). The mean and standard deviation ("Mean" and "SD") of a quantitative variable across all descendents of each child is reported. In addition, for each child, the number of its descendants is reported ("Count"), the number of its descendants who do not have a value for the quantitative variable ("NACount") is reported, and the names of all of its descendants is reported ("DesNames").
getBranchQuant(v1, geneal, colName, gen = 3)
getBranchQuant(v1, geneal, colName, gen = 3)
v1 |
the label of the vertex of interest (in character string format) |
geneal |
the full genealogy (in data frame format) |
colName |
the name of the column of the data frame that contains the quantitative variable of interest (in character string format) |
gen |
the number of generations back to include as ancestors |
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. doi:10.18637/jss.v089.i13
data(statGeneal) DC_Year <- getBranchQuant("David Cox", statGeneal, "gradYear", 15)
data(statGeneal) DC_Year <- getBranchQuant("David Cox", statGeneal, "gradYear", 15)
This function returns zero or more values that indicate the children of the inputted variety.
getChild(v1, geneal)
getChild(v1, geneal)
v1 |
the label of the vertex of interest (in character string format) |
geneal |
the full genealogy (in data frame format) |
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. doi:10.18637/jss.v089.i13
data(sbGeneal) getChild("Tokyo", sbGeneal) getChild("Essex", sbGeneal)
data(sbGeneal) getChild("Tokyo", sbGeneal) getChild("Essex", sbGeneal)
Returns the degree (distance between unweighted edges) between two varieties, where an edge represents a parent-child relationship
getDegree(v1, v2, ig, geneal)
getDegree(v1, v2, ig, geneal)
v1 |
the label of the first vertex of interest (in character string format) |
v2 |
the label of the second vertex of interest (in character string format) |
ig |
the graph representation of the data genealogy (in igraph format) |
geneal |
the full genealogy (in data frame format) |
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. doi:10.18637/jss.v089.i13
data(sbGeneal) ig <- dfToIG(sbGeneal) getDegree("Brim", "Bedford", ig, sbGeneal)
data(sbGeneal) ig <- dfToIG(sbGeneal) getDegree("Brim", "Bedford", ig, sbGeneal)
This function returns a list of the descendants of the inputted variety within and including a given number of generations
getDescendants(v1, geneal, gen = 3)
getDescendants(v1, geneal, gen = 3)
v1 |
the label of the vertex of interest (in character string format) |
geneal |
the full genealogy (in data frame format) |
gen |
the number of generations back to include as descendants |
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. doi:10.18637/jss.v089.i13
data(sbGeneal) getChild("Essex", sbGeneal) getDescendants("Essex", sbGeneal, 1) getDescendants("Essex", sbGeneal, 3)
data(sbGeneal) getChild("Essex", sbGeneal) getDescendants("Essex", sbGeneal, 1) getDescendants("Essex", sbGeneal, 3)
Returns a matrix, where each row contains information about an edge (two vertex names and edge weight, if present) of the full genealogy.
getEdges(ig, geneal)
getEdges(ig, geneal)
ig |
the graph representation of the data genealogy (in igraph format) |
geneal |
the full genealogy (in data frame format) |
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. doi:10.18637/jss.v089.i13
data(sbGeneal) ig <- dfToIG(sbGeneal) getEdges(ig, sbGeneal)
data(sbGeneal) ig <- dfToIG(sbGeneal) getEdges(ig, sbGeneal)
Returns a character list, where rows contains names of the unique nodes in the full genealogy
getNodes(geneal)
getNodes(geneal)
geneal |
the full genealogy (in data frame format) |
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. doi:10.18637/jss.v089.i13
data(sbGeneal) getNodes(sbGeneal)
data(sbGeneal) getNodes(sbGeneal)
This function returns up to two values that indicate the parents of the inputted variety.
getParent(v1, geneal)
getParent(v1, geneal)
v1 |
the label of the vertex of interest (in character string format) |
geneal |
the full genealogy (in data frame format) |
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. doi:10.18637/jss.v089.i13
data(sbGeneal) getParent("Tokyo", sbGeneal) getParent("Essex", sbGeneal)
data(sbGeneal) getParent("Tokyo", sbGeneal) getParent("Essex", sbGeneal)
Determines the shortest path between the two inputted vertices, and takes into account whether or not the graph is directed. If there is a path, the list of vertices of the path will be returned. If there is not a path, a list of character(0) will be returned. Note: For a directed graph, the direction matters. However, this function will check both directions and return the path if it exists.
getPath(v1, v2, ig, geneal, colName, silent = FALSE, isDirected = FALSE)
getPath(v1, v2, ig, geneal, colName, silent = FALSE, isDirected = FALSE)
v1 |
the label of the first vertex of interest (in character string format) |
v2 |
the label of the second vertex of interest (in character string format) |
ig |
the graph representation of the data genealogy (in igraph format) |
geneal |
the full genealogy (in data frame format) |
colName |
the name of the column of the data frame that contains the quantitative variable of interest (in character string format) |
silent |
whether or not to print output (defaults to false) |
isDirected |
whether or not the graph is directed (defaults to 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. doi:10.18637/jss.v089.i13
data(sbGeneal) ig <- dfToIG(sbGeneal) getPath("Brim", "Bedford", ig, sbGeneal, "devYear") getPath("Tokyo", "Volstate", ig, sbGeneal, "yield")
data(sbGeneal) ig <- dfToIG(sbGeneal) getPath("Brim", "Bedford", ig, sbGeneal, "devYear") getPath("Tokyo", "Volstate", ig, sbGeneal, "yield")
Determines the shortest path between the two inputted vertices, and takes into account whether or not the graph is directed. If there is a path, the list of vertices of the path will be returned. If there is not a path, a list of character(0) will be returned. Note: For a directed graph, the direction matters. However, this function will check both directions and return the path if it exists.
getPathOnly(v1, v2, ig, geneal, silent = FALSE, isDirected = FALSE)
getPathOnly(v1, v2, ig, geneal, silent = FALSE, isDirected = FALSE)
v1 |
the label of the first vertex of interest (in character string format) |
v2 |
the label of the second vertex of interest (in character string format) |
ig |
the graph representation of the data genealogy (in igraph format) |
geneal |
the full genealogy (in data frame format) |
silent |
whether or not to print output (defaults to false) |
isDirected |
whether or not the graph is directed (defaults to false) |
Returns the documented date of the inputted variety
getVariable(v1, geneal, colName)
getVariable(v1, geneal, colName)
v1 |
the label of the vertex of interest (in character string format) |
geneal |
the full genealogy (in data frame format) |
colName |
the name of the column of the data frame that contains the quantitative variable of interest (in character string format) |
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. doi:10.18637/jss.v089.i13
data(sbGeneal) getVariable("Essex", sbGeneal, "devYear") getVariable("Tokyo", sbGeneal, "yield")
data(sbGeneal) getVariable("Essex", sbGeneal, "devYear") getVariable("Tokyo", sbGeneal, "yield")
Returns a boolean variable for whether the first variety is a child of the second variety
isChild(child, parent, geneal)
isChild(child, parent, geneal)
child |
possible child variety |
parent |
possible parent variety |
geneal |
the full genealogy (in data frame format) |
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. doi:10.18637/jss.v089.i13
data(sbGeneal) isChild("Essex", "Young", sbGeneal) isChild("Young", "Essex", sbGeneal)
data(sbGeneal) isChild("Essex", "Young", sbGeneal) isChild("Young", "Essex", sbGeneal)
Returns a boolean variable for whether the second variety is a parent of the first variety
isParent(child, parent, geneal)
isParent(child, parent, geneal)
child |
possible child variety |
parent |
possible parent variety |
geneal |
the full genealogy (in data frame format) |
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. doi:10.18637/jss.v089.i13
data(sbGeneal) isParent("Essex", "Young", sbGeneal) isParent("Young", "Essex", sbGeneal)
data(sbGeneal) isParent("Essex", "Young", sbGeneal) isParent("Young", "Essex", sbGeneal)
Converts the list-style-genealogy to a data frame, where each variety has an id value and references its' parent's id value. ID value ranges correspond to generation. It is possible that with more complex genealogical structures the range of id values may need to expand to reduce the probability of two varieties being assigned the same id value.
nodeToDF(tlist, branch = 0, par.id = NA, id = 1)
nodeToDF(tlist, branch = 0, par.id = NA, id = 1)
tlist |
list of varieties |
branch |
of particular variety in the genealogy |
par.id |
the id of the parent |
id |
id offset |
Returns the image object to show the ancestors and descendants of a variety, with the variety highlighted, if desired
plotAncDes(v1, geneal, mAnc = 3, mDes = 3, vColor = "#D35C79")
plotAncDes(v1, geneal, mAnc = 3, mDes = 3, vColor = "#D35C79")
v1 |
the label of the vertex of interest (in character string format) |
geneal |
the full genealogy (in data frame format) |
mAnc |
the maximum number of generations of ancestors of v1 to be displayed (in numeric format) |
mDes |
the maximum number of generations of descendants of v1 to be displayed (in numeric format) |
vColor |
the color of the text of the main variety |
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. doi:10.18637/jss.v089.i13
data(sbGeneal) plotAncDes("Tokyo", sbGeneal, vColor = "red") plotAncDes("Essex", sbGeneal, 2, 3, "blue") + ggplot2::labs(x = "Generation index", y = "")
data(sbGeneal) plotAncDes("Tokyo", sbGeneal, vColor = "red") plotAncDes("Essex", sbGeneal, 2, 3, "blue") + ggplot2::labs(x = "Generation index", y = "")
Returns the image object to show the heat map of degrees between the inputted set of vertices
plotDegMatrix(varieties, ig, geneal)
plotDegMatrix(varieties, ig, geneal)
varieties |
subset of varieties used to generate the heat map |
ig |
the graph representation of the data genealogy (in igraph format) |
geneal |
the full genealogy (in data frame format) |
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. doi:10.18637/jss.v089.i13
https://www.r-project.org for iGraph information
data(sbGeneal) ig <- dfToIG(sbGeneal) varieties <- c("Bedford", "Calland", "Narow", "Pella", "Tokyo", "Young", "Zane") p <- plotDegMatrix(varieties, ig, sbGeneal) p + ggplot2::scale_fill_continuous(low = "white", high = "darkgreen")
data(sbGeneal) ig <- dfToIG(sbGeneal) varieties <- c("Bedford", "Calland", "Narow", "Pella", "Tokyo", "Young", "Zane") p <- plotDegMatrix(varieties, ig, sbGeneal) p + ggplot2::scale_fill_continuous(low = "white", high = "darkgreen")
This function takes the path as input and outputs an ggplot2 object. The image will correctly position the node labels with x-axis representing the node date, and y-axis representing the node path index. Edges between two nodes represent parent-child relationships between those nodes. For visual appeal, there is a grey box that outlines the node label, as well as an underline and overline for each label.
plotPath(path, geneal, colName, colNameY = "", fontFace = 1)
plotPath(path, geneal, colName, colNameY = "", fontFace = 1)
path |
object created from function getPath |
geneal |
the full genealogy (in data frame format) |
colName |
the name of the column of the data frame that contains the quantitative variable of interest (in character string format) |
colNameY |
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. |
fontFace |
fontface for the two nodes of interest (1=plain, 2=bold, 3=italic, 4=bold-italic), DEFAULT is 1 |
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. doi:10.18637/jss.v089.i13
getPath
for information on input path building
data(sbGeneal) ig <- dfToIG(sbGeneal) pathTN <- getPath("Tokyo", "Narow", sbIG, sbGeneal, "devYear") plotPath(pathTN, sbGeneal, "devYear") sbFilt <- sbGeneal[complete.cases(sbGeneal[1:3]),] sbFiltIG <- dfToIG(sbFilt) pathCL <- getPath("Clark", "Lawrence", sbFiltIG, sbFilt, "yield") plotPath(pathCL, sbFilt, "devYear", "yield") + ggplot2::xlab("Dev Year") + ggplot2::ylab("Yield")
data(sbGeneal) ig <- dfToIG(sbGeneal) pathTN <- getPath("Tokyo", "Narow", sbIG, sbGeneal, "devYear") plotPath(pathTN, sbGeneal, "devYear") sbFilt <- sbGeneal[complete.cases(sbGeneal[1:3]),] sbFiltIG <- dfToIG(sbFilt) pathCL <- getPath("Clark", "Lawrence", sbFiltIG, sbFilt, "yield") plotPath(pathCL, sbFilt, "devYear", "yield") + ggplot2::xlab("Dev Year") + ggplot2::ylab("Yield")
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 )
plotPathOnAll( path, geneal, ig, colName, colNameY = "", bin = 12, edgeCol = "gray84", pathEdgeCol = "seagreen", nodeSize = 3, pathNodeSize = 3, pathNodeFont = "bold", nodeCol = "black", animate = FALSE )
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) |
colName |
the name of the column of the data frame that contains the quantitative variable of interest (in character string format) |
colNameY |
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. |
bin |
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 |
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 |
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. 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")
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")
Returns the image object to show the heat map of dates between the inputted set of vertices
plotVariableMatrix( varieties, geneal, colName, xLab = "Variety", yLab = "Variety", legendLab = "Difference in variable" )
plotVariableMatrix( varieties, geneal, colName, xLab = "Variety", yLab = "Variety", legendLab = "Difference in variable" )
varieties |
subset of varieties used to generate the heat map |
geneal |
the full genealogy (in data frame format) |
colName |
the name of the column of the data frame that contains the quantitative variable of interest (in character string format) |
xLab |
string label on the x axis (default is "Variety") |
yLab |
string label on the y axis (default is "Variety") |
legendLab |
string label on the legend (default is "Degree") |
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. doi:10.18637/jss.v089.i13
data(sbGeneal) varieties <- c("Bedford", "Calland", "Narow", "Pella", "Tokyo", "Young", "Zane") p <- plotVariableMatrix(varieties, sbGeneal, "devYear", "Variety", "Variety", "Difference") p + ggplot2::scale_fill_continuous(low = "white", high = "darkgreen")
data(sbGeneal) varieties <- c("Bedford", "Calland", "Narow", "Pella", "Tokyo", "Young", "Zane") p <- plotVariableMatrix(varieties, sbGeneal, "devYear", "Variety", "Variety", "Difference") p + ggplot2::scale_fill_continuous(low = "white", high = "darkgreen")
This data set contains soy bean genealogical information maintained by the United States Department of Agriculture to be used by plant breeders, geneticists, bioinformaticians, pathologists,and many other research workers.
data(sbGeneal)
data(sbGeneal)
a RData
instance, 1 row per each child-parent relationship between soybean varieties
A data frame with 412 rows and 7 variables
Soybean genealogical data
This data contains information on copy number variants, single nucleotide polymorphisms, protein content, and yield, of soybeans. The available data consists of a data frame structure that contains 412 direct child-parent relationships between pairs of soybean varieties. These data were collected from field trials, genetic studies, and United States Department of Agriculture (USDA) bulletins, and date as early as the first decade of the 1900s.
child name of child soybean variety
devYear year child variety was introduced
yield protein yield
yearImputed whether or not the introduced year of the child variety was imputed
parent name of parent soybean variety
"Pedigrees of soybean cultivars released in the United States and Canada." Theodore Hyivitz, C.A. Newell, S.G. Carmer. College of Agriculture, University of Illinois at Urbana-Champaign (1977).
This data set contains academic genealogical information from the Mathematics Genealogy Project, a web-based database serviced by the North Dakota State University Department of Mathematics and the American Mathematical Society. Specifically, this data set represents a subset of the Mathematical Genealogy Project that contains all the parent-child relationships where both parent and child received an advanced degree of statistics as of June 6, 2015.
data(statGeneal)
data(statGeneal)
a RData
instance, 1 row per each individual in the Mathematics Genealogy Project with an advanced degree in statistics. If the child had a parent who was also listed as having received an advanced degree in statistics in the Mathematics Genealogy project, then the row also contains the parental information.
A data frame with 8165 rows and 6 variables
Academic statistics genealogical data
This data contains information on copy number variants, single nucleotide polymorphisms, protein content, and yield, of soybeans. The available data consists of a data frame structure that contains 412 direct child-parent relationships between pairs of soybean varieties. These data were collected from field trials, genetic studies, and United States Department of Agriculture (USDA) bulletins, and date as early as the first decade of the 1900s.
child name of the individual who received an advanced degree in statistics
parent name of the individual who mentored the child and also received an advanced degree in statistics. If the child has no such parent, then this field is an empty string
gradYear year the child received their advanced degree in statistics
country country from which the child received their advanced degree in statistics
school school from which the child received their advanced degree in statistics
thesis title of the thesis the child submitted to receive their advanced degree in statistics. If this information is not available, then this field is an empty string
North Dakota State University and American Mathematical Society (2010). The Mathematics Genealogy Project. Archived Web Site. Retrieved from the Library of Congress, Accessed on March 6, 2015, URL http://www.genealogy.math.ndsu.nodak.edu.