powered by
Column-bind a model matrix to the source data-frame
addIndicators(data, formula, drop.intercept = TRUE)
source data-frame or matrix.
model formula used to add columns.
logical as to whether to drop the column named '(Intercept)'.
data-frame or matrix.
This function calls model.matrix, conditionally checks for and removes '(Intercept)', and binds with the original data-frame (or matrix).
model.matrix
# NOT RUN { addIndicators(data.frame(f = c("a","a","b")), ~f+0) # }
Run the code above in your browser using DataLab