I am working on a large dataset. I have variable in the data frame For example called.
Part<-c(1,2,3,4,5,6,7)
Disease_codes>- c(A100,A145,B165,B187,B102,C132,D156)
df<-data.frame(Part,Disease_codes)
Actually I want to categorize all the disease codes starting from "A" as "Blood cancer". The Disease codes starting from alphabet A (for example A100,A145) are Blood Cancer. Because i need to exclude the participants having Blood cancer from my studies. Offcourse i cannot do this mannually as i have huge number of participants. So how can i make a subset of the people who have disease codes starting with A and then exclude them from my data frame. For example I want following kind of out put.
Blood_Cancer_Part<-c(1,2)
Part_without_Blood_cancer<-c(3,4,5,6,7)