Hi,
I haven't followed, but I think you want something like:
subsetData<- bigData[ , c("Colname1", "Colname2", grep("partialName",
colnames(bigData)))]
HTH,
Ivan
Le 11/24/2010 13:51, barah a écrit :
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
--
Ivan CALANDRA
PhD Student
University of Hamburg
Biozentrum Grindel und Zoologisches Museum
Abt. Säugetiere
Martin-Luther-King-Platz 3
D-20146 Hamburg, GERMANY
+49(0)40 42838 6231
[email protected]
**********
http://www.for771.uni-bonn.de
http://webapp5.rrz.uni-hamburg.de/mammals/eng/1525_8_1.php
______________________________________________
[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.