Combes [EMAIL PROTECTED]
10/13/2005 05:34 AM
To
Brian S Cade [EMAIL PROTECTED]
cc
Subject
Re: [R] subsetting with by() or other function??
maybe an example of the data you have and the data you want could be
helpful for the people of the list to understand, and so to be able to
help you
PROTECTED]
10/13/2005 10:04 AM
To
Brian S Cade [EMAIL PROTECTED]
cc
Subject
Re: [R] subsetting with by() or other function??
I think this should be something like:
dat$LAG1DBC - tapply(dat$DBC, dat$LOCID, function(x) c(NA,
x[-length(x)]))
I hope it helps.
Best,
Dimitris
Dimitris