Re: [R] extract data features from subsets

2011-06-06 Thread Dennis Murphy
Hi: Here's one way using package plyr and its ddply() function. ddply() takes a data frame as input and expects to output either a scalar or a data frame. In this case, we want the latter. library(plyr) f <- function(df) { mn <- min(df$result) tms <- df$time[df$result == mn] subdf <-

[R] extract data features from subsets

2011-06-06 Thread Williams Scott
I have a large dataset similar to this: ID timeresult A 1 5 A 2 2 A 3 1 A 4 1 A 5 1 A 6 2 A 7 3 A 8 4 B 1 3 B 2 2 B 3 4 B 4 6 B 5 8