I have a training set that looks like
Name Day Area X Y Month Night ATTACK Monday LA -122.41 37.78 8 0 VEHI
y should be a numeric or factor vector containing the outcome for each sample, not a matrix. Using
y
train(y = make.names(trainDF$Name), ...)
helps, where make.names modifies values so that they could be valid variable names.
make.names