[R] data lost in cv.tree?

Alexy Khrabrov braver at pobox.com
Sat Sep 27 00:54:48 CEST 2003

OK, since this flew without a sound, let me rephrase it,
and omit dramatics.  Before I bother Brian, who wrote the
original cv.tree, I hope somebody will clue me in!

So, we have a nested call tree:

Abel calls Cain; Cain calls cv.tree.

Abel defines X, and fmla <- y~., and calls Cain(y~.,X).

Cain begats a tr <- tree(fmla, X), and then passes it along
to cv.tree(tr).

cv.tree complains, via its mouthpiece model.frame.default,
that it can't find X.

How can one supply X in that case?  It's a natural call sequence,
and putting X into the global frame is unnatural, and I'm not
sure that R's kinky search path is teh culprit here, it's how
formula and tree know which data they refer to, isn't it?


More information about the R-help mailing list