From e62e6df4c80037368526f45ee49a44e6e88cacb8 Mon Sep 17 00:00:00 2001 From: Chris Sobczak Date: Fri, 12 Jun 2026 19:06:04 -0700 Subject: Add groupings to the network graph --- man/networkplot.Rd | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'man') diff --git a/man/networkplot.Rd b/man/networkplot.Rd index 055bc46..a4a622d 100644 --- a/man/networkplot.Rd +++ b/man/networkplot.Rd @@ -4,11 +4,13 @@ \alias{networkplot} \title{Network Plot} \usage{ -networkplot(R, title = NULL) +networkplot(R, groups = NULL, title = NULL) } \arguments{ \item{R}{A square numeric matrix with names columns and rows} +\item{groups}{Optional data.frame mapping nodes to groups} + \item{title}{Optional plot title} } \value{ @@ -24,5 +26,11 @@ entries are the strength of the relationship X <- matrix(data = rnorm(100), nrow = 10) R <- cor(X) networkplot(R, title = 'Example Correlation Plot') +colnames(R) <- as.character(seq_len(ncol(R))) +g <- data.frame( +node = colnames(R), +group = rep(c('A', 'B'), length.out = ncol(R)) +) +networkplot(R, groups = g, title = 'Example Correlation Plot') } -- cgit v1.2.3