R/GRgetGroupVars.R

Defines functions GRgetGroupVars

Documented in GRgetGroupVars

#' Grouping Variables
#'
#' Given a SummarizedExperiment object created by \code{\link{GRfit}},
#' this function returns a vector of the grouping variables used to create 
#' the object.
#'
#' @param fitData a SummarizedExperiment object, generated by the GRfit 
#' function.
#'
#' @return A vector of grouping variables
#' @author Nicholas Clark
#' @details
#' Given a SummarizedExperiment object created by \code{\link{GRfit}},
#' this function returns a vector of the grouping variables used to create the 
#' object. These are the variables in the dataset that are not averaged over. 
#' This is simply a convenient accessor function, equivalent to 
#' \code{metadata(fitData)[[2]]}.
#' @seealso To create the object needed for this function, see
#' \code{\link{GRfit}}.
#' @examples
#' # Load Case A (example 1) input
#' data("inputCaseA")
#' head(inputCaseA)
#' # Run GRfit function with case = "A"
#' output1 = GRfit(inputData = inputCaseA,
#' groupingVariables = c('cell_line','treatment'))
#' groupVars = GRgetGroupVars(output1)
#' groupVars
#' @export

GRgetGroupVars <- function(fitData) {
  return(metadata(fitData)[[2]])
}
uc-bd2k/GRmetrics documentation built on Nov. 11, 2020, 4:10 p.m.