result <- rforest(
ketchup,
rvar = "choice",
evar = c("price.heinz28", "price.heinz32", "price.heinz41", "price.hunts32"),
lev = "heinz28"
)
pred <- predict(result, pred_data = ketchup)
ketchup <- store(ketchup, pred, name = c("heinz28", "heinz32", "heinz41", "hunts32"))
Run the code above in your browser using DataLab