Description Usage Arguments Details Value See Also Examples
Convert a data frame and model formula
to a list
containing the input variables as a matrix x
and the output variable
as a vector y
. These structures are commonly used by various modelling
functions such as glmnet
.
1 |
data |
A data frame |
formula |
A |
All operators made available by formula
are allowed.
Two-element list containing input variables as a matrix x
, and
output variable as a vector y
1 2 3 4 | model_as_xy(mtcars, hp ~ mpg)
model_as_xy(mtcars, hp ~ .)
model_as_xy(mtcars, hp ~ mpg * hp)
model_as_xy(mtcars, ~ .)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.