Wensui Liu wrote: > > subset(table1, rate != 999&id == table2$id) > > On 2/6/07, lalitha viswanath <[EMAIL PROTECTED]> 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. ______________________________________________ R-help@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.