s-news
[Top] [All Lists]

[S] S-Plus Bug

To: "'s-news'" <s-news@wubios.wustl.edu>
Subject: [S] S-Plus Bug
From: "Gunter, Bert" <bert_gunter@merck.com>
Date: Mon, 25 Sep 2000 11:27:24 -0400
Sender: owner-s-news@wubios.wustl.edu
Dear S-News listers:

We have encountered the following inconsistencies in S-Plus's set functions:

 >test1<-as.factor(letters[1:5])
> test2<-as.factor(letters[3:8])
> test1
[1] a b c d e
> test2
[1] c d e f g h
## First ...
 setdiff(test1,test2)
[1] a b
Levels:
[1] "a" "b" "c" "d" "e"
## This looks sensible. But ...

> intersect(test1,test2)
[1] c d e
Levels (first 5 out of 6):
[1] "c" "d" "e" "f" "g"
> levels(.Last.value)
[1] "c" "d" "e" "f" "g" "h"
### This does not seem correct. Problems with factors again! Worse yet ....

> union(test1,test2)
[1] 1 2 3 4 5 6
## which seems completely incorrect

Perhaps these functions need to be made generic with methods for factors in
order to get correct behavior.

Cheers,

Bert Gunter
Biometrics Research
Merck & Company
PO Box 200, Rahway, NJ 07065-0900
Ph: (732) 594-7765    Fax: 594-1565

"The business of the statistician is to catalyze the scientific learning
process."    --  George E.P. Box

-----------------------------------------------------------------------
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

<Prev in Thread] Current Thread [Next in Thread>
  • [S] S-Plus Bug, Gunter, Bert <=