[R] grep and strings

K Fung fungile at yahoo.com
Tue Apr 27 01:54:50 CEST 2004

I have the following command:

  grep("\.a\.", names(temp)))

where temp is a vector with names

I want to count the number of entries that contain the
sequence of characters ".a.".  However, R seems to
return all entries that contain "a" (every entry
contains "." in this example).

How should I fix this?  Thanks

More information about the R-help mailing list