I don't know if this is any faster, but it has no loop. There are
improvements that can be made if speed is too slow. Try it on your
data:
> x <- data.frame(id=c("001","001","001","001","002","002","002","002","002"),
+ year=c(2000,2001,2002,2003,1996,1997,1998,1999,2000),
+
Hi all,
I currently work on a survey which contains biographical data stored
in a chronological way, ie something like :
id year variable
001 2000 0
001 2001 0
001 2002 1
001 2003 0
002 1996 0
002 1997 0
002 1998 1
002 1999
2 matches
Mail list logo