s-news
[Top] [All Lists]

bd.filter.rows

To: s-news@lists.biostat.wustl.edu
Subject: bd.filter.rows
From: "Gareth Williams" <garethdaviswilliams@hotmail.com>
Date: Mon, 12 Feb 2007 07:20:01 -0600

Dear S-users,

I would like to filter the rows of a big data frame object according to whether they appear in the rows of a data frame object. For instance,

x <- bdFrame(a=rep(1:10,2), b=runif(1:20))

and

y <- data.frame(a=c(1,4,6))

I want to select the rows of x according to whether x$a appears in y$a. I think this is

newdata <- bd.filter.rows(list(x, y), "in1$a==in2$a")

However, rather than getting a new data frame with 6 rows I get one with 1 row.

Does anyone know how to achieve the appropriate data frame, e.g. something like
  a                   b
1  1 0.375442212
4  4 0.783326366
6  6 0.836408332
11  1 0.912288268
14  4 0.348985139
16  6 0.858758209

Thanks for any help in advance.

Regards,
Gareth

_________________________________________________________________
From predictions to trailers, check out the MSN Entertainment Guide to the Academy Awards® http://movies.msn.com/movies/oscars2007/?icid=ncoscartagline1


<Prev in Thread] Current Thread [Next in Thread>
  • bd.filter.rows, Gareth Williams <=