Re: [R] R loop within a loop

2011-10-12 Thread saliluna
I've also tried to make the function work for one particular group, then apply the same function to the whole data frame with all groups using by() or lapply() as follow. But I'm still receiving error messages. Could someone please explain what is happening here? dfdfdf <- function(localdata){ ord

[R] R loop within a loop

2011-10-12 Thread saliluna
Hi, I'm working on a loop function for a large dataset which contains 1000 different groups. I would like to reconstruct the order of events within each group by using a loop function in R. (Currently the order of events are based on the ascending order of prev_event within the group) A demo dat