I was reading this post when I came across with a question.
Why (in the post's dataframe) this function doesn't return the same value
>df[df$X3==c(1,2),]
X1 X2 X3
1 s1 45.11 1
4 s1 51.41 2
10 s1 43.12 2
17 s5 25.40 1
as this function?
>df[df$X3 %in% c(1,2),]
X1 X2 X3
1 s1 45.11 1
2 s1 45.13 1
3 s1 53.42 2
4 s1 51.41 2
9 s3 43.58 2
10 s1 43.12 2
17 s5 25.40 1
18 s5 25.50 1
I used to believe that both are kind of equal. What's the difference between them?
Thanks in advance.