powered by
Incidence Matrix of Combined Levels within a Factor
at.set(x, level)
incidence matrix for the set level in x
level
factor
set of factor levels
Jarrod Hadfield j.hadfield@ed.ac.uk
at.level
fac<-gl(3,10,30, labels=letters[1:3]) x<-rnorm(30) model.matrix(~at.set(fac,2:3):x)
Run the code above in your browser using DataLab