[R] Error in mvpart example

Gavin Simpson gavin.simpson at ucl.ac.uk
Sat Feb 27 11:43:56 CET 2010


These functions (rpart, the mvpart wrapper, and summary.rpart) are
fairly complex doing many things.

For contributed packages you'd be best served by contacting the
author/maintainer. I've CC'd Glenn (the maintainer) here.

HTH

G

On Fri, 2010-02-26 at 13:55 +0000, Wearn, Oliver wrote:
> Dear all,
> 
> I'm getting an error in one of the stock examples in the 'mvpart'
> package. I tried:
> 
> require(mvpart)
> data(spider)
> fit3 <- rpart(gdist(spider[,1:12],meth="bray",full=TRUE,sq=TRUE)~water
> +twigs+reft+herbs+moss+sand,spider,method="dist") #directly
> from ?rpart
> summary(fit3)
> 
> ...which returned the following:
> 
> Error in apply(formatg(yval, digits - 3), 1, paste, collapse = ",",
> sep = "") : 
>   dim(X) must have a positive length
> 
> This seems to be a problem with the cross-validation, since the
> "xerror" and "xstd" columns are missing from the summary table as
> well.
> 
> Using the mpart() wrapper results in the same error:
> 
> fit4<-mvpart(gdist(spider[,1:12],meth="bray",full=TRUE,sq=TRUE)~water
> +twigs+reft+herbs+moss+sand,spider,method="dist")
> summary(fit4)
> 
> Note, changing the 'method' argument to ="mrt" seems, superficially,
> to solve the problem. However, when the dependent variable is a
> dissimilarity matrix, shouldn't method="dist" be used (as per the
> examples)?
> 
> Thanks, in advance, for any help on this error.
> 
> Oliver
> ______________________________________________
> 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