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 + 1L)] : non-numeric argument to binary operator # the only two arguments I supply are both numeric > mode(tr$srv_dt) [1] "numeric" > mode(tr$Rmbr) [1] "numeric" IMPORTANT NOTICE: This communication, including any attachment, contains information that may be confidential or privileged, and is intended solely for the entity or individual to whom it is addressed. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message is strictly prohibited. Nothing in this email, including any attachment, is intended to be a legally binding signature. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.