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
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
> 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] <- "*"
>
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 "*"
4 matches
Mail list logo