From 580b82e444680f865bcd90c60ee6eab1cfa5c283 Mon Sep 17 00:00:00 2001 From: Max Bladen <60872845+Max-Bladen@users.noreply.github.com> Date: Tue, 15 Nov 2022 10:49:58 +1100 Subject: [PATCH] Enhancement for Issue #260 (#261) * Enhancement for Issue #260 feat: added 'legend.title' parameter (takes a string) for `circosPlot()`. Allows for control over legend title * Enhancement for Issue #260 docs: updated documentatation with `legend.title` parameter --- DESCRIPTION | 2 +- R/circosPlot.R | 4 +++- man/circosPlot.Rd | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 55c7d93f..169e0514 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -63,5 +63,5 @@ biocViews: ImmunoOncology, MultipleComparison, Classification, Regression -RoxygenNote: 7.1.2 +RoxygenNote: 7.2.2 Encoding: UTF-8 diff --git a/R/circosPlot.R b/R/circosPlot.R index e6a266f1..41b80fc4 100644 --- a/R/circosPlot.R +++ b/R/circosPlot.R @@ -36,6 +36,7 @@ #' @param size.variables size of the variable labels #' @param size.labels size of the block labels #' @param legend Logical. Whether the legend should be added. Default is TRUE. +#' @param legend.title String. Name of the legend. Defaults to "Expression". #' @param linkWidth Numeric. Specifies the range of sizes used for lines linking #' the correlated variables (see details). Must be of length 2 or 1. Default to c(1). See details. #' @param ... For object of class \code{block.splsda}, advanced plot parameters: @@ -98,6 +99,7 @@ circosPlot <- function(object, ...) UseMethod('circosPlot') size.variables = 0.25, size.labels = 1, legend = TRUE, + legend.title = "Expression", linkWidth = 1, ...) { @@ -403,7 +405,7 @@ circosPlot <- function(object, ...) UseMethod('circosPlot') col = color.cor, pch = 19, cex=size.legend, bty = "n") # Second legend bottom righ corner if(line==TRUE) - legend(x=figSize-(circleR/3), y = (circleR/3), title="Expression", + legend(x=figSize-(circleR/3), y = (circleR/3), title=legend.title, legend=levels(Y), ## changed PAM50 to Y col = lineCols, pch = 19, cex=size.legend, bty = "n",ncol=ncol.legend) # third legend top left corner diff --git a/man/circosPlot.Rd b/man/circosPlot.Rd index 21e9535d..5c8fddb3 100644 --- a/man/circosPlot.Rd +++ b/man/circosPlot.Rd @@ -22,6 +22,7 @@ size.variables = 0.25, size.labels = 1, legend = TRUE, + legend.title = "Expression", linkWidth = 1, ... ) @@ -68,6 +69,8 @@ see examples.} \item{legend}{Logical. Whether the legend should be added. Default is TRUE.} +\item{legend.title}{String. Name of the legend. Defaults to "Expression".} + \item{linkWidth}{Numeric. Specifies the range of sizes used for lines linking the correlated variables (see details). Must be of length 2 or 1. Default to c(1). See details.}