summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Sobczak <chris@sobczak.family>2026-06-15 18:19:35 -0700
committerChris Sobczak <chris@sobczak.family>2026-06-15 18:19:35 -0700
commite5071ae6091eafc4a98bc280a23349dcb2261da3 (patch)
tree2a7bcc84687a6d82e064e76a63539c066324b23c
parentc22a8c7b71a54d3c604fef8ab68a10b50e3178cd (diff)
Add sizing and fix legend
-rw-r--r--R/networkplot.R14
-rw-r--r--man/networkplot.Rd12
2 files changed, 1 insertions, 25 deletions
diff --git a/R/networkplot.R b/R/networkplot.R
index 9d251ea..10dfc01 100644
--- a/R/networkplot.R
+++ b/R/networkplot.R
@@ -14,17 +14,6 @@
#'
#' @return A ggraph object
#'
-#' @examples
-#' 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')
-#'
#' @import ggraph
#' @import igraph
#'
@@ -152,8 +141,7 @@ networkplot <- function(R, groups = NULL, group_label = NULL, title = NULL, r_la
high = 'blue',
midpoint = 0,
limits = c(-1, 1),
- name = r_label,
- guide = ggplot2::guide_colourbar()
+ name = r_label
) +
# operates on node data from the layout
# leaf is a logical vector (provided by the ggraph object g)
diff --git a/man/networkplot.Rd b/man/networkplot.Rd
index c0a0a3e..12e5363 100644
--- a/man/networkplot.Rd
+++ b/man/networkplot.Rd
@@ -33,15 +33,3 @@ entries are the strength of the relationship
(ex: correlation, partial correlation).
Based on https://r-graph-gallery.com/310-custom-hierarchical-edge-bundling.html
}
-\examples{
-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')
-
-}