I also got the same error, but it was because of some illegal characters in the factor levels of one the columns.
I used make.names
function and corrected the factor levels:
levels(FooData$BarColumn) <- make.names(levels(FooData$BarColumn))
Then the problem was resolved.