I had the same problem with my initial run, so I checked the variables that I turned on, and one of them (factor variable) had only 1 level. So I deleted it and it worked. Also make sure you do not have NA in your variables.
To check for NA:
sapply(data[, c(variable_names), with=FALSE], function(x) sum(is.na(x)))
To reset NA:
data_no_NAs <- na.omit(data[, c(variable_names), with = FALSE])
source
share