I have a vector data of factors whose levels are (0) No, (1) Yes and (8) Residue.
Here is the value of the second element of that vector, data[2]: (1) Yes
What I don't understand is that the value of data[2] == "Yes" is FALSE. Also surprising is that the value of as.integer(data[2)] is 2. Shouldn't it be 1? And shouldn't the value of data[2] == "Yes" be TRUE.
I just started to use R, so I still don't know much about it, but I really don't understand this. Can someone please explain to me what's going on?