I want to find the elements that contains star character in the following vector.
s <- c(\"A\",\"B\",\"C*\",\"D\",\"E*\") grep(\"*\",s) [1] 1 2 3 4 5
Another option is to use fixed=TRUE
fixed=TRUE
grep('*', s,fixed=TRUE)