leeper / prediction

Tidy, Type-Safe 'prediction()' Methods
https://cran.r-project.org/package=prediction
Other
89 stars 14 forks source link

find_data() only works if model created with a formula #16

Closed leeper closed 7 years ago

leeper commented 7 years ago

Example:

library("MASS")
tr <- sample(1:50, 25)
train <- rbind(iris3[tr,,1], iris3[tr,,2], iris3[tr,,3])
test <- rbind(iris3[-tr,,1], iris3[-tr,,2], iris3[-tr,,3])
cl <- factor(c(rep("s",25), rep("c",25), rep("v",25)))
zq <- qda(train, cl)
find_data(zq)
## Error in terms.formula(formula, data = data) : 
##   argument is not a valid model