I got a data frame which containg a column containing codes separated by space. And I want to search those ids by applying "<" or ">" etc arithmatic operaters.
Input data frame:
df <- data.frame(Id=c(101, 102,103), Codes=c("1 2 3", "2 4 5", "4 5"))
I tried finding id's who have codes greater than 3. so that I can get 102 and 103 as output.
df[df$Codes > "3", ]
but this is giving me 103 id. what I am missing??