Hi I have table1 which has the foll. columns id age rate and table2 which has the foll. columns id count I wish to get data from table1 for all the ids which are persent in table2 and where the rate is not equal to 999. The ids in table2 are a subset of those in table1 and every id in table2 has an entry in table1. I would appreciate your input regarding the above. Thanks in advance Lalitha
Hi I have table1 which has the foll. columns id age rate and table2 which has the foll. columns id count I wish to get data from table1 for all the ids which are persent in table2 and where the rate is not equal to 999. The ids in table2 are a subset of those in table1 and every id in table2 has an entry in table1. I would appreciate your input regarding the above. Thanks in advance Lalitha ____________________________________________________________________________________ No need to miss a message. Get email on-the-go
subset(table1, rate != 999&id == table2$id) On 2/6/07, lalitha viswanath <lalithaviswanath at yahoo.com> wrote:> Hi > I have table1 which has the foll. columns > id age rate > > and table2 which has the foll. columns > id count > > I wish to get data from table1 for all the ids which > are persent in table2 and where the rate is not equal > to 999. > The ids in table2 are a subset of those in table1 and > every id in table2 has an entry in table1. > > I would appreciate your input regarding the above. > > Thanks in advance > Lalitha > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >-- WenSui Liu A lousy statistician who happens to know a little programming (http://spaces.msn.com/statcompute/blog)
Wensui Liu wrote:> > subset(table1, rate != 999&id == table2$id) > > On 2/6/07, lalitha viswanath <lalithaviswanath at yahoo.com> wrote: >> Hi >> I have table1 which has the foll. columns >> id age rate >> >> and table2 which has the foll. columns >> id count >> >> I wish to get data from table1 for all the ids which >> are persent in table2 and where the rate is not equal >> to 999. >> The ids in table2 are a subset of those in table1 and >> every id in table2 has an entry in table1. >> >> I would appreciate your input regarding the above. >%in%, not = subset(table1, rate != 999&id %in% table2$id) -- View this message in context: http://www.nabble.com/-R--Query-about-merging-two-tables-tf3181164.html#a8828460 Sent from the R help mailing list archive at Nabble.com.