Description Usage Arguments Details Value Examples
View source: R/plot_conn_comps.R
This is a simple wrapper for some tidygraph/ggraph functions that will let you find the connected components of a graph in which the related pairs are connected by edges. It also makes a plot of them.
1 | plot_conn_comps(Pairs)
|
Pairs |
the tibble that comes out of |
Note that it appears that the 'ggraph' package must be loaded for the plot output of this function to print correctly.
This returns a list with two components:
conn_comps
: a tibble with three columns:
name
: the name of the sample
cluster
: the index of the connected component the sample belongs to
cluster_size
: the number of samples belonging
to that cluster
plot
: a ggraph/ggplot plot object showing the connected components as vertices with
edges between them.
1 2 3 4 5 6 7 8 9 10 11 | # get a Pairs tibble from the stored data
Pairs <- compile_related_pairs(species_1_slurped_results_1gen$samples)
PCC <- plot_conn_comps(Pairs)
# look at the conn_comps:
head(PCC$conn_comps)
# if you want to print the plot, that seems to require
# loading the ggraph library
library(ggraph)
PCC$plot
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.