-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf
Of arun
Sent: Wednesday, August 14, 2013 1:08 PM
To: Noah Silverman
Cc: R help
Subject: Re: [R] How to extract last value in each group
Hi,
Try:
dat1- read.table(text=
Date Time O H L
help r-help@r-project.org
Sent: Wednesday, August 14, 2013 5:22 PM
Subject: Re: [R] How to extract last value in each group
Or with plyr:
R library(plyr)
R ans - ddply(x, .(Date), function(df) df[which.max(df$Time),])
-steve
On Wed, Aug 14, 2013 at 2:18 PM, Steve Lianoglou
lianoglou.st
Hi,
Looks like you have some free time on your hands :-)
Something looks a bit off here, though, I was surprised to see the
time you reported for the data.table option:
#separate the data.table creation step:
dt1 - data.table(dat2, key=c('Date', 'Time'))
system.time(ans - dt1[, .SD[.N],
...@gmail.com; David
Winsemius dwinsem...@comcast.net; R help r-help@r-project.org
Sent: Thursday, August 15, 2013 3:52 PM
Subject: Re: [R] How to extract last value in each group
Hi,
Looks like you have some free time on your hands :-)
Something looks a bit off here, though, I was surprised
Hi,
On Thu, Aug 15, 2013 at 1:38 PM, arun smartpink...@yahoo.com wrote:
I tried it again on a fresh start using the data.table alone:
Now.
dt1 - data.table(dat2, key=c('Date', 'Time'))
system.time(ans - dt1[, .SD[.N], by='Date'])
# user system elapsed
# 40.908 0.000 40.981
#Then
)
identical(res1,as.data.frame(res3New))
#[1] TRUE
A.K.
- Original Message -
From: Steve Lianoglou lianoglou.st...@gene.com
To: arun smartpink...@yahoo.com
Cc: R help r-help@r-project.org
Sent: Thursday, August 15, 2013 4:48 PM
Subject: Re: [R] How to extract last value in each group
Hi
,row.names)- attr(res1,row.names)
identical(resNew,res1)
#[1] TRUE
A.K.
- Original Message -
From: Steve Lianoglou lianoglou.st...@gene.com
To: arun smartpink...@yahoo.com
Cc: R help r-help@r-project.org
Sent: Thursday, August 15, 2013 4:48 PM
Subject: Re: [R] How to extract last
Hi,
On Thu, Aug 15, 2013 at 4:03 PM, arun smartpink...@yahoo.com wrote:
HI Steve,
Thanks for testing.
When I run a slightly bigger dataset:
set.seed(1254)
name- sample(letters,1e7,replace=TRUE)
number- sample(1:10,1e7,replace=TRUE)
datTest- data.frame(name,number,stringsAsFactors=FALSE)
lianoglou.st...@gene.com
To: arun smartpink...@yahoo.com
Cc: R help r-help@r-project.org
Sent: Thursday, August 15, 2013 11:28 PM
Subject: Re: [R] How to extract last value in each group
Hi,
On Thu, Aug 15, 2013 at 4:03 PM, arun smartpink...@yahoo.com wrote:
HI Steve,
Thanks for testing.
When I run
Hello,
I have some stock pricing data for one minute intervals.
The delivery format is a bit odd. The date column is easily parsed and used as
an index for an its object. However, the time column is just an integer
(1:1807)
I just need to extract the *last* entry for each day. Don't
:
Sent: Wednesday, August 14, 2013 3:56 PM
Subject: [R] How to extract last value in each group
Hello,
I have some stock pricing data for one minute intervals.
The delivery format is a bit odd. The date column is easily parsed and used as
an index for an its object. However, the time column
r-help@r-project.org
Cc:
Sent: Wednesday, August 14, 2013 3:56 PM
Subject: [R] How to extract last value in each group
Hello,
I have some stock pricing data for one minute intervals.
The delivery format is a bit odd. The date column is easily parsed and used
as an index for an its
tibco.com
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf
Of arun
Sent: Wednesday, August 14, 2013 1:08 PM
To: Noah Silverman
Cc: R help
Subject: Re: [R] How to extract last value in each group
Hi,
Try:
dat1- read.table(text
Software
wdunlap tibco.com
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf
Of arun
Sent: Wednesday, August 14, 2013 1:08 PM
To: Noah Silverman
Cc: R help
Subject: Re: [R] How to extract last value in each group
Hi,
Try
-boun...@r-project.org] On
Behalf
Of arun
Sent: Wednesday, August 14, 2013 1:08 PM
To: Noah Silverman
Cc: R help
Subject: Re: [R] How to extract last value in each group
Hi,
Try:
dat1- read.table(text=
Date Time O H L C U D
06/01/2010 1358 136.40 136.40
[mailto:
r-help-boun...@r-project.org] On Behalf
Of arun
Sent: Wednesday, August 14, 2013 1:08 PM
To: Noah Silverman
Cc: R help
Subject: Re: [R] How to extract last value in each group
Hi,
Try:
dat1- read.table(text=
Date Time O H L C U D
06/01/2010
Spotfire, TIBCO Software
wdunlap tibco.com
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf
Of arun
Sent: Wednesday, August 14, 2013 1:08 PM
To: Noah Silverman
Cc: R help
Subject: Re: [R] How to extract last value in each group
17 matches
Mail list logo