Description Usage Arguments Details Value See Also Examples

`model.Matrix`

creates design matrix, very much like the
standard **R** function `model.matrix`

, however returning a
dense or sparse object of class `modelMatrix`

.

1 2 3 | ```
model.Matrix(object, data = environment(object),
contrasts.arg = NULL, xlev = NULL,
sparse = FALSE, drop.unused.levels = FALSE, ...)
``` |

`object` |
an object of an appropriate class. For the default
method, a model formula or a |

`data` |
a data frame created with |

`contrasts.arg` |
A list, whose entries are values (numeric
matrices or character strings naming functions) to be used
as replacement values for the |

`xlev` |
to be used as argument of |

`sparse` |
logical indicating if the result should be sparse
(of class |

`drop.unused.levels` |
used only when |

`...` |
further arguments passed to or from other methods. |

`model.Matrix()`

is a simple wrapper either (`sparse = FALSE`

)
around the traditional `model.matrix()`

returning a
`"ddenseModelMatrix"`

, or (`sparse = TRUE`

)
around `sparse.model.matrix()`

, returning a
`"dsparseModelMatrix"`

object.

`model.Matrix`

creates a design matrix from the description given
in `terms(object)`

, using the data in `data`

which must
supply variables with the same names as would be created by a call to
`model.frame(object)`

or, more precisely, by evaluating
`attr(terms(object), "variables")`

.

For more details, see `model.matrix`

.

an object inheriting from class `modelMatrix`

, by
default, `ddenseModelMatrix`

.

`model.matrix`

,
`sparse.model.matrix`

.

1 2 3 4 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.