powered by
contr.wsum(x, weights = rep.int(1.0, length(x)))
x
nlevels(x)
nlevels(x)- 1
contr.sum
x <- factor(rep(LETTERS[1:3], c(10, 20, 30))) contr.wsum(x)
Run the code above in your browser using DataLab