tsippel wrote:
The suggestion below was made.

df1$Date <- as.Date(df1$Date)
df2$Date <- as.Date(df2$Date)
ifelse(df1$ID==df2$ID & df1$Date-df2$Date<0.5,df1$y-df2$y, NA)

However, because my dataframe rows do not align, I need the conditionals to
be tested on every combination of cells.  I'm starting to think I need to
use tapply? Tim

I'd look at outer() or try a merge() before the operation to get things aligned. It is not clear to me what form of output you desire if you look at "every combination of cells".

--
   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalga...@biostat.ku.dk)              FAX: (+45) 35327907

______________________________________________
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.

Reply via email to