Hi,
I want to select observations based on the absence of a single word of a string variable. for example: if I have a variable indicating multiple answers like "a b c", I want to identify all observations that does not include "c". Example
# answers
1 a b c d
2 a b d
3 a c d
4 a d
I need a code to identify the observations "2" and "4". I know the "strpos()" function that helps identifying observation with a certain element, but I'm not sure if it can be used to identify observations that misses a certain element.
Thank you in advance
I want to select observations based on the absence of a single word of a string variable. for example: if I have a variable indicating multiple answers like "a b c", I want to identify all observations that does not include "c". Example
# answers
1 a b c d
2 a b d
3 a c d
4 a d
I need a code to identify the observations "2" and "4". I know the "strpos()" function that helps identifying observation with a certain element, but I'm not sure if it can be used to identify observations that misses a certain element.
Thank you in advance
Comment