Learn R Programming

bbl (version 0.1.5)

initialize,bbl-method: Instantiate bbl object

Description

Creates bbl object based on arguments provided.

Usage

# S4 method for bbl
initialize(.Object, data, predictors = NULL,
  groups = NULL, y = "y", ...)

Arguments

.Object

Object of class bbl to be created.

data

Data frame of training data. Expected to contain both predictor and response variables in columns and instances in rows.

predictors

List of predictor factor levels. If not provided, will be inferred from data columns with names not equal to y.

groups

Vector of characters for response factor levels. If not provided, will be inferred from data response column named y.

y

Column name in data containing response data. Can also be column number.

...

Other parameters (not used).

Value

Object of class bbl.

Details

Note that with argument data only, predictor factor levels will be ordered by default. Also some of predictors may have values in data less than expected, which would result in fewer levels of predictor levels. By explicitly providing predictors, this default behavior can be overriden. Predictors in data with a single factor level will be removed. Same applies to groups for response levels.

Examples

Run this code
# NOT RUN {
## Factors model
titanic <- freq2raw(as.data.frame(Titanic), Freq='Freq')
summary(titanic)
model <- bbl(data=titanic, y='Survived')
model
# }

Run the code above in your browser using DataLab