I have been working in project in R. I worked with R before but never faced such problem. I am trying to take a subset from my full dataset (longitudinal data) using the "subset" command as follows:
subset(data, data$Code == c("A21", "A26", "A29", "A42", "A48", "A51", "B20"))
but the subset is taking only the codes "A21", "A26", "A42", "A51", "B20" in the new dataset. Can you please tell me why it is doing that?
I also tried to see if I have any problem in code or the main dataset using the code
subset(data, data$Code == c("A29", "A48"))
the new dataset is alright. I am really confused why the command is taking only the selective data.