Skip to content
Prev 304809 / 398503 Next

Create a function to number each repeated visit or measurements

Your email was scrambled and therefore difficult to decipher.  However, using the plyr package, you could do something like

library(plyr)
ddply(your_data_frame,"AreaID",transform,visit=0:(length(AreaID)-1))


Hope this is helpful,

Dan

Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA 98504-5204