decision tree machine learning

Hi I have an error. Please could anyone help me? Thank you Sara
tree(DrugID~Age+Gender, data=train)-> mod_tree1
Warning messages:
1: In tree(DrugID ~ Age + Gender, data = train) :
NAs introduced by coercion
2: In tree(DrugID ~ Age + Gender, data = train) :
NAs introduced by coercion

plot(mod_tree1)
Error in plot.tree(mod_tree1) : cannot plot singlenode tree

Must be a data issue

There are many ways to understand basic things about your data, one that is in base R is the str() function.

str(train)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.