BuildModelData: Build data.table for use in model

Description Usage Arguments Details Value

View source: R/BuildModelData.R

Description

BuildModelData is an internal function that constructs a data.table from groups, x, and y to be used in regression model.

Usage

1
BuildModelData(comparison, x, y = NULL, groups = NULL, by = NULL, xName, yName)

Arguments

x

A matrix or list of matrices containing values for model.

y

A matrix containing values to be used on left-hand side of model (e.g. dependent variable). At least one of y or groups must be provided.

groups

A data.frame containing sample group data. At least one of y or groups must be provided. Column one of groups data.frame must contain sample names that correspond to column names of x and y.

by

Character vector specifying column names in groups that will be used to split data if stratified analysis desired. Ignored if groups not provided.

xName

Names of matrices provided in x. If x is a list with named elements, defaults to list names. Else, defaults to x1, x2, ..., xn where n is the number of matrices provided in x.

yName

Name of matrix or name of column in groups to be used on left-hand of model. (see formula details for default values)

comparisons

Matrix containing rownames or numbers from each dataset for all desired comparisons. If not provided, comparisons matrix will be build (see details for defaults).

Details

This function binds together desired rows in x and y with groups object to create model data.

Value

A data.table with all data to be used in model.


okg3/MultiDataAnalysis documentation built on March 28, 2020, 12:20 p.m.