[R] mvpart error
Gavin Simpson
gavin.simpson at ucl.ac.uk
Tue Mar 24 13:21:07 CET 2009
On Sun, 2009-03-22 at 22:45 -0400, Josh Stumpf wrote:
> Hello all,
>
> When attempting a classification tree using mvpart, I get the following
> error:
>
> > thesis2.mvp=mvpart(bat_sp~., data=alltrees.df)
> Error in all(keep) :
> unused argument(s) (c(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE))
>
> bat_sp is an unordered categorical variable
That looks wrong for a start. mvpart is an extension to the rpart
routines to allow *multivariate* recursive partitioning. You'd be better
off just using rpart directly. Have you tried that (i.e.
require("rpart") in a clean session, not require("mvpart") )? Does it
work then?
> , and the predictors are a
> mixture of categorical and continuous variables. I had run the algorithm
> successfully in the past (about 1.5 years ago) on a preliminary subset of
> the same dataset using a previous version of R The current system is R
> 2.8.1 running under Ubuntu Jaunty. Any ideas as to the cause?
You've not given us much to go on. Please provide either the data
(privately; I promise to use it only to work through this issue and
delete immediately thereafter) or (to the list) the output from:
str(alltrees.df)
I tried to replicate your data and it ran fine in the version of mvpart
on my linux box, so seeing what your data looks like may help.
Also provide the results of traceback() called immediately after you get
the error, eg:
> thesis2.mvp=mvpart(bat_sp~., data=alltrees.df)
Error in all(keep) :
> unused argument(s) (c(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
> TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE))
> traceback()
I can't find a call to 'all(keep)' in either the mvpart() or rpart()
functions, so without knowing where the error occurred or the means to
replicate exactly the error, our hands are tied behind our backs
somewhat.
Finally, send the output from sessionInfo() so we can see what versions
of software you are using.
HTH
>
> Josh Stumpf
>
> Eastern Michigan University
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
--
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Dr. Gavin Simpson [t] +44 (0)20 7679 0522
ECRC, UCL Geography, [f] +44 (0)20 7679 0565
Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/
UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
More information about the R-help
mailing list