ligges@statistik.uni-dortmund.de
2001-Nov-15 07:24 UTC
[Rd] rhs of == does not work with a list of items. should it ? (PR#1173)
Paul.White@dsto.defence.gov.au wrote:> > > Hello bug people, > > > > Version: > > platform = i686-pc-linux-gnu > > arch = i686 > > os = linux-gnu > > system = i686, linux-gnu > > status > > major = 1 > > minor = 3.1 > > year = 2001 > > month = 08 > > day = 31 > > language = R > > > > is this a bug ? > > > > x <- 1:10 > > x==4:5 > > [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE > > > > Nothing said it should but nothing said it shouldn't . My expectation was > > that it would successively try > > each of the values in the list and or the result for each item in the x > > vector. ie it would pick out all the matches > of 4 or 5. > > > [1] FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSEThat's not a bug! R extends the vector 4:5 to have the same length as 1:10 and compares these two vectors: 4 1 5 2 4 3 5 4 4 5 5 6 4 7 5 8 4 9 5 10 So there is no position with "4:5 == 1:10"! Test it with: 2:10 == 4:5. What you want is (I guess): 1:10 %in% 4:5 Uwe Ligges -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Maybe Matching Threads
- rhs of == does not work with a list of items (PR#1172)
- Error when building doc/html
- Error when building doc/html
- ads_sasl_spnego_krb5_bind failed: Program lacks supportfor encryption type [SEC=UNCLASSIFIED]
- plotmath in underlined style; was: Re: [R] Underline in expression(). (PR#7286)