There's no error in you post so it's hard to tell what is going wrong.
When I run your code, it cannot fine the CrossTable
or confusionMatrix
functions. Try loading the library first. I know that caret
has the confusionMatrix
function.
Is this related to this similar post?