Displaying 1 result from an estimated 1 matches for "lead_func_temp".
2008 Oct 15
1
comparing with lead function
...08-06-08 11:24:00; 765329002557
2008-06-08 12:33:00; 765329002557"),as.is
=TRUE,sep=";",strip.white=TRUE,header=TRUE)
closeAllConnections()
DF$time <- ifelse(DF$timestamp > as.POSIXct("2008-07-01"), 1, 0)
last_event <- lapply(split(test, test$ID), function(.df){
lead_func_temp <- c(NA,.df$TIME [ - length(.df$TIME)])
temp <-
data.frame(ID=as.character(.df$ID),TIME=.df$TIME,
DIFF=rep(lead_func_temp,nrow(.df)))
return(temp)
})
DF$last_event <- do.call(rbind, last_event)
Mike
[[alternative HTML version deleted]]