Hi, I have a list of 150 strings, say, ap,:
aajkss dfghjk sdfghk ... xxcvvn And I would l like to grep out these strings from column names in another file, af,. I've tried the following but none seem to work: aps <- af[,grep(ap, colnames(af), value=TRUE)] aps <- af[,grep(ap, colnames(af), value=FIXED)] aps <- af[,grep(as.character(list(ap),colnames(af))] and also aps <- unique (grep(ap, colnames(af)) Is there another way I can do this - maybe without using grep? Thanks! Kate. ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.