That's exactly what I was thinking. Thanks tons.
Sent from Yahoo Mail on Android
From:"arun"
Date:Sun, Feb 15, 2015 at 2:47 AM
Subject:Re: Difference in dates for unique ID
HI Farnoosh,
Not sure I understand the expected output.� The difference between the first 2
days is "136 days"
May be
HI Farnoosh,
Not sure I understand the expected output. The difference between the first 2
days is "136 days"
May be this helps
library(data.table)
dcast.data.table(setDT(df)[, list(Visit=.N, Diff=
as.numeric(abs(diff(as.Date(Date, format='%d-%b-%y') ,
by = ID], ID+Vi
2 matches
Mail list logo