Hi:

Try some modification of the following toy example:

df <- data.frame(names = as.character(replicate(100, paste(sample(letters,
3), collapse = ''))),
                   x1 = rnorm(100), x2 = rnorm(100))
tgts <- sample(df$names, 20)    # target list of names
df[df$names %in% tgts, ]      # yields a 20 row data frame

HTH,
Dennis

On Tue, Feb 8, 2011 at 6:57 AM, pankaj borah <pankajborah2k3@yahoo.co.in>wrote:

> Hi,
>
> I have two lists
>
> 1) List1- 30,000 rows and 104 columns
>
> 2) List2- a list of 14000 selected rownames  from List 1
>
> Now, I want to extract all the 104 columns of List1  matching with the
> 14000 selected rownames from List2.
>
> Psedocode will be something like this:
> match rownames(List2) with rownames(List1)
> extract selected matched 104 coloumns from (List1)
> strore in-> List3
>
> So the resulting List3 will contain 14,000 rows and 104 coloumns.
>
> How do I do it in R ?
>
>
>
> Regards,
>
> P Barah
> Department of Biology,
> Norwegian University of Science & Technology (NTNU)
>  Realfagbygget, N-7491 Trondheim, Norway
>
>
>
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help@r-project.org 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.
>
>

	[[alternative HTML version deleted]]

