Error in function (classes, fdef, mtable) :
unable to find an inherited method for function "where", for signature "constparty"
This is due to changes in the structure of the BinaryTree Class in partykit package. See following code for fixing this problem.
library(party)
library(partykit)
airq <- subset(airquality, !is.na(Ozone))
airct <- ctree(Ozone ~ ., data = airq)
where(airct)
# Error!
# Fix error:
detach("package:partykit", unload=TRUE)
airct <- ctree(Ozone ~ ., data = airq) # you have to rebuild the tree
where(airct) # now it works!
No comments:
Post a Comment