Have used the suggested solution (the second method, as it seems a bit
leaner) on my real data, and it works perfectly. Thanks.
--
View this message in context:
http://r.789695.n4.nabble.com/Create-new-records-based-on-event-dates-in-a-data-frame-tp4673839p4674082.html
Sent from the R help mail
Message -
From: arun
To: Gavin Rudge
Cc: R help
Sent: Thursday, August 15, 2013 10:10 AM
Subject: Re: [R] Create new records based on event dates in a data frame
Hi,One way would be:
df<-
data.frame(case,obsdate=as.Date(obsdate,format="%d/%m/%Y"),score,stringsAsFactors=F
#5 b 2005-11-10 2011-03-31 79
#6 c 2001-04-01 2011-03-31 65
A.K.
- Original Message -
From: Gavin Rudge
To: "'r-help@r-project.org'"
Cc:
Sent: Thursday, August 15, 2013 9:22 AM
Subject: [R] Create new records based on event dates in a data frame
One of t
One of those simple tasks, but I can't get to first base with it. I've got a
data set of observations of subjects over a 10 year period beginning on 1st
April 2001 and ending on 31st March 2011. One of may variables is a score
based on an intervention on a given date. Before the intervention t
4 matches
Mail list logo