I’d like to do this:
library(party)
# cts <- ???
n <- c(50, 100, 116)
for(i in 1:length(n)) {
data <- airq[1:n[i], ]
airct <- ctree(Ozone ~ ., data)
cts[i] <- airct
}
..but don’t know which type of object I can use for assigning the ctree results to.
Thanks for any pointers,
Kay
A
listis usually the answer.But a better way is to use
lapply(list-apply) here. No for-loop required and a list is returned.