Skip to content
Prev 360655 / 398503 Next

Grep command

Yes, but the answer is likely to depend on the actual patterns of strings in your real data, so the sooner you go find a book or tutorial on regular expressions the better.  This is decidedly not R specific and there are already lots of resources out there.

Given the example you provide,  the pattern "age$" should work. However, that is probably not sufficiently selective for a practical data set so start learning to fish (design regex patterns) yourself.