getGroupsFromDesign: Split input matrix(es) based on the design matrix.

View source: R/designMats.R

getGroupsFromDesignR Documentation

Split input matrix(es) based on the design matrix.

Description

This function splits the input matrix(es) based on a design matrix, into a named list of subsetted matrices. If the design matrix has no names, this function will create names for the resulting list of matrices.

Usage

getGroupsFromDesign(inputMat, design, inputMatB = NULL, secondMat = FALSE)

Arguments

inputMat

Input (e.g., expression) matrix which will be subsetted.

design

Standard design matrix, must specify at least two conditions. For more info, see ?model.matrix

inputMatB

Optional input (e.g., expression) matrix which will be subsetted in the same way.

secondMat

Logical value indicating whether there is a second input matrix to be subsetted.

Value

A list whose first element is a list of subsetted matrices and whose second element is a list of group names.

Examples

data(darmanis); data(design_mat); darmanis_subset = darmanis[1:30, ]
groups_from_design = getGroupsFromDesign(inputMat = darmanis_subset, design = design_mat)
str(groups_from_design)

andymckenzie/DGCA documentation built on Sept. 15, 2023, 5:04 a.m.