[R] "conditional duplicates"?
Christian Schulz
ozric at web.de
Wed Nov 10 13:52:29 CET 2004
Hi,
i would like check a repeated measurement dataset, whether
cases (which (id) could be more than one time included and not all same
times included.)
have more than one times the same SMONTH!?
#This pseudo code didn't work with a for loop, because the [i+1] isn't
known.
How i could refer to [i+1] ?
if(ID[i] == ID[i+1] & SMONTH[i] !=[i+1]) {res[i] <- 0 }
if(ID[i] == ID[i+1] & SMONTH[i] == [i+1]) {res[i] <- 1 }
many thanks,
christian
More information about the R-help
mailing list