factor2ind | R Documentation |
Create an indicator matrix of dimension length(x) x (nlevels(x)-1) with the column corresponding to the baseline level removed (by default the first level is used as baseline).
factor2ind(x, baseline)
x |
a variable. |
baseline |
a string indicating the reference level. |
a matrix
x = gl(4, 2, labels = c( "A", "B", "C", "D")) factor2ind(x) factor2ind(x, "C")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.