Hi Sarah,

Thanks a lot for the suggestion. It is working for me. 
subsetData<- bigData[,grep(partialName, colnames(bigData))]


But if i want to extract multiple columns along with the columns with
similar names, how do i that? Say the others column have similar values for
all the columns with similar partialnames. I tried the following

subsetData<- bigData[,grep("partialName", "Colname1", "Colname2",
colnames(bigData))]

It did not work.
Do you have any suggestion ?

Regards,

Pankaj Barah

-- 
View this message in context: 
http://r.789695.n4.nabble.com/Sub-setting-a-data-frame-by-partial-column-names-tp1577672p3057205.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
[email protected] mailing list
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.

Reply via email to