[R] RE: set functions

Jens Oehlschlägel-Akiyoshi jens.oehlschlaegel-akiyoshi at mdfactory.de
Tue Jan 4 18:54:35 CET 2000


> length(setdiff(x,y))==0 appears to be about twice as fast....

but isn't the same, is it?

> length(setdiff(1:10, 1:15))==0
[1] TRUE
> "equiv" <- function(x, y) all(c(match(x, y, 0)>0, match(y, x, 0)>0))
> equiv(1:10, 1:15)
[1] FALSE

or isn't setdiff expected to do

> setdiff(1:10, 1:15)
numeric(0)
> setdiff(1:15, 1:10)
[1] 11 12 13 14 15

what it currently does?


--
   O__  ---- Peter Dalgaard             Blegdamsvej 3
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-
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 at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list