Re: [R] Data frame self-join with no duplicates

2010-09-27 Thread jim holtman
try sqldf: > require(sqldf) > x <- read.table(textConnection("YearPrice + 200110 + 200220 + 200330"), as.is=TRUE, header=TRUE) > sqldf("select a.*, b.* + from x as a, x as b + where a.Year > b.Year", method='raw') Year Price Year Price 1 200220 200110 2 200330

Re: [R] Data frame self-join with no duplicates

2010-09-27 Thread Xin Zhang
Thanks Dennis. I will explore that. On Mon, Sep 27, 2010 at 7:45 AM, Dennis Murphy wrote: > Hi: > > One option is to read your data frame into R and then use your SQL code in > conjunction with the sqldf package. It uses SQLite as its engine. > > HTH, > Dennis > > > On Mon, Sep 27, 2010 at 4:29

Re: [R] Data frame self-join with no duplicates

2010-09-27 Thread Dennis Murphy
Hi: One option is to read your data frame into R and then use your SQL code in conjunction with the sqldf package. It uses SQLite as its engine. HTH, Dennis On Mon, Sep 27, 2010 at 4:29 AM, Xin Zhang wrote: > Suppose I have the following data frame (df): > > YearPrice > --

[R] Data frame self-join with no duplicates

2010-09-27 Thread Xin Zhang
Suppose I have the following data frame (df): YearPrice --- 200110 200220 200330 I would like to produce another data frame like this: a.Yeara.Priceb.Yearb.Price 200220200110 200330