Not sure if its guaranteed but this sqlite join does seem to preserve
the order of the first data frame.
> library(sqldf)
> BOD
Time demand
118.3
22 10.3
33 19.0
44 16.0
55 15.6
67 19.8
> BODrev <- BOD[6:1,]; BODrev
Time demand
67 19.8
55 15.6
ng that why is it changing the order or what order is it
taking when I specified sort=F.
Regards
Utkarsh
Original Message --------
Subject: Re: [R] help in merging
From: milton ruser
Date: Fri, December 25, 2009 1:38 am
To: utkarsh.sing...@global-analytics.c
Hi there,
You can add a order column on x or y and after use this field to order z.
Like
z<-z[order(z$orderfield),]
To generate a order on x or y you can do something like
x$xorder<-1:nrow(x)
cheers
milton
On Thu, Dec 24, 2009 at 2:26 PM, wrote:
>
> Hi All,
> I want to "merge" two datase
Hi All,
I want to "merge" two datasets by column "ID" and I don't want the result to
be sorted by "ID". I am doing the following:
> z = merge(x, y, by = "ID", sort=F)
The result is not sorted by "ID". But (as oppose to what I expected) it is
not even in the original order of eith
4 matches
Mail list logo