plot_conn_comps: plot the graph showing the connected components

Description Usage Arguments Details Value Examples

View source: R/plot_conn_comps.R

Description

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.

Usage

1

Arguments

Pairs

the tibble that comes out of compile_related_pairs(). For this function it must have, at least the columns id_1, id_2, and dom_relat.

Details

Note that it appears that the 'ggraph' package must be loaded for the plot output of this function to print correctly.

Value

This returns a list with two components:

Examples

 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

CKMRpop documentation built on July 17, 2021, 5:07 p.m.