I am using the dummies package to generate dummy variables for categorical variables, some with more than two categories.
testdf<- data.frame(
"A" = as.factor(c(1,2,2,3,3,1)),
"B" = c('A','B','A','B','C','C'),
"C"= c('D','D','E','D','D','E'))
#
#Generate dummy variables:
#
testdf<- cbind(testdf, dummy(testdf$C, sep='_'))
testdf<- cbind(testdf, dummy(testdf$B, sep='_'))
For both commands I get:
Warning message: In model.matrix.default(~x - 1, model.frame(~x - 1), contrasts = FALSE) : non-list contrasts argument ignored
The results seem correct though. Can you please advice regarding the reason of the warning?