Created
May 21, 2011 21:23
-
-
Save johnjosephhorton/984913 to your computer and use it in GitHub Desktop.
functional programming way to extract the within-subject order that some time-stamped event occurred
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# accept time would be seconds from the unix epoch | |
results$rank <- mapply( | |
function(time,worker_id){ | |
which(time==sort(subset(results, WorkerId==worker_id)$accept_time)) | |
}, results$accept_time, results$WorkerId) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment