[18909] in s-news-athena
Re: [S] S-PLUS 2000 problem
daemon@ATHENA.MIT.EDU (tom richards)
Tue Aug 10 18:26:38 1999
Date: Tue, 10 Aug 1999 18:19:41 -0400 (EDT)
From: tom richards <richards@toutatis.pci.upmc.edu>
To: "Gibiansky, Leonid" <GibiansL@globomax.com>
Cc: "'splus'" <s-news@wubios.wustl.edu>
In-Reply-To: <90CD4EECC337D3118B1C00A0C96F6A4D06D6CD@globomax.com>
Message-Id: <Pine.SOL.3.96.990810181029.12577A-100000@toutatis>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
> Just a warning:
>
> This is sufficiently bad by itself, but S-PLUS 2000 behaved
> even worse:
> > test <- data.frame(a=T,b=T,c=F)
> > test
> a b c
> 1 TRUE TRUE FALSE
> > test.vector <- c(test$a,test$b,test$c)
> > test.vector
> [1] 1 1 1
> >
> Is there any other known problems with S-PLUS 2000 ?
> Thanks,
> Leonid
I don't think this is a bug in Splus 2000, Leonid. You defined, in the
data frame test, three one-level factors, a,b, and c:
> levels(test$a)
[1] "TRUE"
> levels(test$b)
[1] "TRUE"
> levels(test$c)
[1] "FALSE"
Then, when you stripped off the levels attribute to make the vector
test.vector, Splus 2000 properly recorded the number of the level that was
defined, 1 in each case. Consider the following example, which Splus 2000
also handles correctly:
> atest<-data.frame(a=factor("x",levels=c("x","y")),+
b=factor("y",levels=c("x","y")),+
c=factor("x",levels=c("x","y")))
> atest.vector<-c(atest$a,atest$b,atest$c)
> atest.vector
[1] 1 2 1
I'm not sure about Splus 4.5, though, because I just uninstalled it a few
weeks ago!
Tom
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~:
: Thomas J. Richards _/ _/ _/_/_/ _/_/ _/_/_/ :
: Statistician _/ _/ _/ _/ _/ _/ _/ :
: Biostatistics Center _/ _/ _/ _/ _/ _/ :
: U. Pittsburgh Cancer Institute _/ _/ _/_/_/ _/ _/ :
: 3600 Forbes Ave Suite 400A _/ _/ _/ _/ _/ _/ :
: Pittsburgh, PA 15213 _/_/ _/ _/_/ _/_/_/ :
: 412-647-6852 fax: 412-647-5687 :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----------------------------------------------------------------------
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