I am trying to extract the names of the countries which don't start with either "C" or "B" from this vector.
vec <- c("Colombia", "Chile", "Brazil", "Ecuador", "Peru", "Mexico")
This works for C or B only:
vec[substring(vec,1,1) != 'C']
I am trying to combine both cases but this doesn't work
vec[(substring(vec,1,1) != 'C') | (substring(vec,1,1) != 'P')]
How can I combine both conditions in just one statement?