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
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
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
> --
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
4 matches
Mail list logo