[S] Re: rpart() error message

Thomas J. Richards (richards@toutatis.pci.upmc.edu)
Tue, 8 Sep 1998 14:43:49 -0400 (EDT)


Many thanks to all who responded to my query below. Despite my insistence
to the contrary, I DID have NaN values in my dataset, which I had ported
to Splus 4.5, release 2, from Excel. It seems that missing values
from other data sources are translated into NaN's--not simply NA's--
upon importing into S-plus. Thanks to Professor Ripley and Michael
Conklin, I can simply use this command:

dframe <- as.data.frame(lapply(dframe,function(x) /
{if (is.numeric(x)){x[is.nan(x)]<-NA;};return(x)}))

Also, Professor Harrell has directed me to his Hmisc library, which, I
assume, will fix this and much more, in a function called
cleanup.import(). I will look at it. Thanks, again, to everyone.

Tom Richards

On Tue, 8 Sep 1998, Thomas J. Richards wrote:

> Date: Tue, 8 Sep 1998 12:02:30 -0400 (EDT)
> From: "Thomas J. Richards" <richards@toutatis.pci.upmc.edu>
> To: s-news@wubios.wustl.edu
> Subject: rpart() error message
>
> Hello:
>
> I am using the rpart() software for recursive partitioning, to analyze
> survival data. Having successfully duplicated the stagec example in the
> manual,I'm now using my own data. I am getting the following error message:
>
> Error in .C("s_to_rp",: subroutine s_to_rp: 1 NaN value(s) in argument 10
>
> I don't understand. Argument 10 to the C function s_to_rp is as.single(X).
> The X matrix has only only one entry which is NA, none which are NaN, and NA's
> are OK, since argument 13 to s_to_rp is NAOK=T. Has anyone else had a similar
> experience using rpart? Is there some way that I can get around this error
> message? Any other suggestions? Many thanks.
>
> Tom Richards
>
> University of Pittsburgh
> Cancer Institute
>
>

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news