ron-r
5/4/2014 - 7:23 AM

How can I find only columns that contain specific chars

How can I find only columns that contain specific chars

grep("^Tar", names(dat), value=TRUE) #will catch all variables that contain the phras in the begining of the word.

or 
grep("Tar", names(dat), value=TRUE) # will catch all variables that contain the phrase : Tar

http://stackoverflow.com/questions/23381528/how-can-i-apply-filter-on-columns-using-the-table-function