rpart problem (PR#313)

david_m_potter@groton.pfizer.com david_m_potter@groton.pfizer.com
Fri, 5 Nov 1999 19:10:24 +0100 (MET)


* * * Just the Facts * * *
call to rpart() with a factor response gives
the error message:

"Error: first argument is array, but not matrix."

* * * Example Code * * * 
==============================================
R : Copyright 1999, The R Development Core Team
Version 0.65.1 Release (October 07, 1999)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type	"?license" or "?licence" for distribution details.

R is a collaborative project with many contributors.
Type	"?contributors" for a list.

Type	"demo()" for some demos, "help()" for on-line help, or
    	"help.start()" for a HTML browser interface to help.
Type	"q()" to quit R.

> library(rpart)
> x _ 1:50
> y _ as.factor(rbinom(50,1,.5))
> fit _ rpart(y~x,method="class")
Error: first argument is array, but not matrix.
> 

* * * Version Information * * *
==============================================

--please do not edit the information below--

Version:
 platform = sparc-sun-solaris2.6
 arch = sparc
 os = solaris2.6
 system = sparc, solaris2.6
 status = Release
 major = 0
 minor = 65.1
 year = 1999
 month = October
 day = 07
 language = R

Search Path:
 .GlobalEnv, package:rpart, Autoloads, package:base


* * * Unsolicited Hypothesis * * * 

In rpart(), I believe this line causes the error message:

        temp <- rp$dnode[, -(1:3)] %*% diag(init$parms[1:numclass] *
nobs/init$counts)

Thanks for your attention.

David


David M. Potter
Mathematical & Statistical Sciences
Pfizer Central Research
PO Box 8003/832
Groton, CT 06340-8003
Tel 860-715-1769 ; Fax 860-715-5445
potterdm@groton.pfizer.com


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._