[R] grep pattern

Kang Min ngokangmin at gmail.com
Fri May 20 17:57:42 CEST 2011


Hi all,

I'm trying to subset a pattern in a vector. Each argument has 6
letters, and I need those that start with Z and end with Z.

e.g.
 x <- c("ZFHSJK", "ZFHJKZ","ZIOPWE","ZLKJSD","ZKFLPZ")

I've looked up other discussions but still can't seem to find the
answer.

Thanks.
Kangmin



More information about the R-help mailing list