I have a very simple data frame that has a ID column and a column that indicates if the row was a true positive or not (either 1 or 0). I aggregated the data by ID using plyr's each function and calculated the number of occurrences for the ID and the mean value for true positive usingagg <- aggregate(tp ~ v_id, data, each(mean, length))
That seemed to have worked well and I got the following data:
head(agg)
v_id tp.mean tp.length
1 A51599 1.0 4
2 A51670 1.0 2
3 A51672 1.0 2
4 A51676 1.0 2
5 A51677 1.0 2
6 A51678 0.5 2
That data is nice, but now I would like to filter out all rows where the tp.length is less than 100. I tried all kinds of things with the subset function as well with the '[]' operator with conditions in it. The tp column seems to be a matrix and I have no idea, how to get to the tp.length in the filter.
Thank you!