Re: [R] unexpected behavior in apply

2021-10-13 Thread Derickson, Ryan, VHA NCOD via R-help
t;1" NA > > [2,] "b" "2" NA > > [3,] "c" "3" " 6" > > > "a"<=3 > > [1] FALSE > > > "2"<=3 > > [1] TRUE > > > "6"<=3 > > [1] FALSE > > > > Not

Re: [R] [EXTERNAL] Re: unexpected behavior in apply

2021-10-08 Thread Derickson, Ryan, VHA NCOD via R-help
3 > [1,] "a" "1" NA > [2,] "b" "2" NA > [3,] "c" "3" " 6" > > "a"<=3 > [1] FALSE > > "2"<=3 > [1] TRUE > > "6"<=3 > [1] FALSE > > Note that there is a

[R] unexpected behavior in apply

2021-10-08 Thread Derickson, Ryan, VHA NCOD via R-help
Hello, I'm seeing unexpected behavior when using apply() compared to a for loop when a character vector is part of the data subjected to the apply statement. Below, I check whether all non-missing values are <= 3. If I include a character column, apply incorrectly returns TRUE for d3. If I onl