I create a Model-tree with the following command:
Tree_Model <- RWeka::M5P(Formule_Train, data = AB_Train)
Then the following line executes fine inside a R-chunk in a Rmd-file:
Tree_Model_Test <- predict(Tree_Model, newdata=AB_Test)
But when I try to knit the document, I get this error:
Error in .jcall(o, "Ljava/lang/Class;", "getClass") :
RcallMethod: attempt to call a method of a NULL object.
Calls: <Anonymous> ... .predictions_for_instances -> .has_method -> .jcall
Any suggestions?