You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: R/omics-class.R
+21-20Lines changed: 21 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -839,12 +839,12 @@ omics <- R6::R6Class(
839
839
#' @description
840
840
#' Alpha diversity based on \link{diversity}
841
841
#' @param col_name A character variable from the `metaData`.
842
-
#' @param metric An alpha diversity metric as input to \link{diversity}.
843
-
#' @param group_by A column name to perform grouped statistical test in \link{diversity_plot} (default: NULL).
842
+
#' @param metric An alpha diversity metric as input to \link{diversity} (default: \code{"shannon"}).
843
+
#' @param group_by A column name to perform grouped statistical test in \link{diversity_plot} (default: \code{NULL}).
844
844
#' @param Brewer.palID A character name for the palette set to be applied, see \link[RColorBrewer]{brewer.pal} or \link{colormap}.
845
845
#' @param evenness A boolean wether to divide diversity by number of species, see \link[vegan]{specnumber}.
846
846
#' @param paired A boolean value to perform paired analysis in \link[stats]{wilcox.test} and samplepair subsetting via [`samplepair_subset()`](#method-samplepair_subset)
847
-
#' @param p.adjust.method A character variable to specify the p.adjust.method to be used, default is 'fdr'.
847
+
#' @param p.adjust.method A character variable to specify the p.adjust.method to be used (default: \code{'fdr'}).
848
848
#' @examples
849
849
#' library("OmicFlow")
850
850
#'
@@ -868,7 +868,7 @@ omics <- R6::R6Class(
868
868
#' }
869
869
#' @seealso \link{diversity_plot}
870
870
alpha_diversity=function(col_name,
871
-
metric=c("shannon", "invsimpson", "simpson"),
871
+
metric="shannon",
872
872
Brewer.palID="Set2",
873
873
group_by=NULL,
874
874
evenness=FALSE,
@@ -884,6 +884,21 @@ omics <- R6::R6Class(
884
884
cli::cli_abort("The specified {.val {col_name}} does not exist in the {.field metaData}.")
885
885
}
886
886
887
+
if (!is.null(group_by)) {
888
+
if (!is.character(group_by) || length(group_by) !=1) {
889
+
cli::cli_abort("{.val {group_by}} must be a character and of length 1")
0 commit comments