[R] Query about merging two tables

Vladimir Eremeev wl2776 at gmail.com
Tue Feb 6 16:57:24 CET 2007



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.



More information about the R-help mailing list