Re: [R] A behaviour pattern that I find mysterious.

2020-02-26 Thread Rolf Turner
Thanks to Marc and Duncan for setting me straight. I guess the piece of the puzzle that I was overlooking is the fact that lexicographic ordering for string comparison depends on locale. It would also have helped me a bit if I'd done the RTFM thing and looked at ?"<" !!! Thanks again. c

Re: [R] A behaviour pattern that I find mysterious.

2020-02-26 Thread Duncan Murdoch
On 26/02/2020 8:09 p.m., Rolf Turner wrote: Consider the following: x <- letters[1:5] x < 0 This gives [1] FALSE FALSE FALSE FALSE FALSE which kind of makes sense, I guess, though I would a priori have expected all NAs. But then do: x[3] <- "*" x < 0 This gives [1] FALSE FALSE TRUE F

Re: [R] A behaviour pattern that I find mysterious.

2020-02-26 Thread Marc Schwartz via R-help
> On Feb 26, 2020, at 8:09 PM, Rolf Turner wrote: > > > Consider the following: > > x <- letters[1:5] > x < 0 > > This gives > >> [1] FALSE FALSE FALSE FALSE FALSE > > which kind of makes sense, I guess, though I would a priori have expected all > NAs. > > But then do: > > x[3] <- "*" >

[R] A behaviour pattern that I find mysterious.

2020-02-26 Thread Rolf Turner
Consider the following: x <- letters[1:5] x < 0 This gives [1] FALSE FALSE FALSE FALSE FALSE which kind of makes sense, I guess, though I would a priori have expected all NAs. But then do: x[3] <- "*" x < 0 This gives [1] FALSE FALSE TRUE FALSE FALSE which puzzles me. Why is "*"