class.ind | R Documentation |
Generates a class indicator function from a given factor.
class.ind(cl)
cl |
factor or vector of classes for cases. |
a matrix which is zero except for the column corresponding to the class.
Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.
set.seed(99)
a <- rbinom(20, 4, 0.5)
table(a)
b <- class.ind(a)
str(b)
t(cbind(a, b))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.