add_intercept_column | R Documentation |
data
This function adds an integer column of 1
's to data
.
add_intercept_column(data, name = "(Intercept)")
data |
A data frame or matrix. |
name |
The name for the intercept column. Defaults to |
If a column named name
already exists in data
, then data
is returned
unchanged and a warning is issued.
data
with an intercept column.
add_intercept_column(mtcars)
add_intercept_column(mtcars, "intercept")
add_intercept_column(as.matrix(mtcars))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.