Hello,
Maybe you want
by(tr$srv_dt, tr$Rmbr, diff, lag=1, difference=1)
Can't you ?dput a data example?
dput(head(tr, 30)) # paste the output of this in a post
Hope this helps,
Rui Barradas
Em 10-03-2014 16:10, Mckinstry, Craig escreveu:
I have been trying to process a data.frame (tr) o
I have been trying to process a data.frame (tr) on a grouping factor (Rmbr)
using diff
to find differences between srv_dt (a date) by Rmbr and keep getting the
following error message
> tmp <- by(tr,tr$Rmbr, diff, tr$srv_dt, lag=1, difference=1)
Error in r[i1] - r[-length(r):-(length(r) - lag +
2 matches
Mail list logo