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