Hi, Huali, there is another way to do so library(sqldf) wanted <- sqldf("select * from X inner join Y on X.A = Y.A and X.B = Y.A")
2008/1/26 zhihuali <[EMAIL PROTECTED]>: > > Hi netters, > Suppose I have two data frames X and Y. X has three colnames A, B and C. Y > has three colnames A,B and D. > > I want to combine them into one matrix, joining the rows having the same A > and B values (X$A==Y$A and X$B = Y$B). So the resulting dataframe has four > variables/columns: A,B,C and D. > > I was wondering what's the best way to do it in R. Could anyone give me some > advice? > > Thanks! > > Zhihua Li > > > _________________________________________________________________ > 手机也能上 MSN 聊天了,快来试试吧! > > [[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. > > -- =============================== WenSui Liu Statistical Project Manager ChoicePoint Precision Marketing (http://spaces.msn.com/statcompute/blog) =============================== ______________________________________________ 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.