> contrasts(afactor)
[,1] [,2] [,3] [,4] [,5]
1 -1 -1 -1 -1 -1
2 1 -1 -1 -1 -1
3 0 2 -1 -1 -1
4 0 0 3 -1 -1
5 0 0 0 4 -1
32 0 0 0 0 5
> afactor = c("fish","meat","chicken","horse")
> afactor = as.factor(afactor)
> levels(afactor)
[1] "chicken" "fish" "horse" "meat"
> contrasts(afactor)
[,1] [,2] [,3]
chicken -1 -1 -1
fish 1 -1 -1
horse 0 2 -1
meat 0 0 3
> options(contrasts=c("contr.treat","contr.poly"))
> contrasts(afactor)
Error in get(x, envir, mode, inherits) : variable "contr.treat" of mode "function" was not found
> contrasts(afactor)
Error in get(x, envir, mode, inherits) : variable "contr.treat" of mode "function" was not found
> options(contrasts=c("contr.treatment","contr.poly"))
> contrasts(afactor)
fish horse meat
chicken 0 0 0
fish 1 0 0
horse 0 1 0
meat 0 0 1