Re: [R] Selecting a maximum value in same ID

2014-03-08 Thread arun
Hi, You could do this either: DF[unlist(with(DF,tapply(B,list(ID),FUN=function(x) x %in% max(x,] #or  DF[unlist(with(DF,by(B,ID,FUN=function(x) x%in% max(x,] #or library(plyr)  DF[ddply(DF,.(ID),summarize,B %in% max(B))[,2],] A.K. Hi, I am struggling with this issue and need some help

Re: [R] Selecting a maximum value in same ID

2014-03-08 Thread Pete Brecknock
Lee wrote > Hi, > > I am struggling with this issue and need some helps. The data set 'DF' > includes persons' IDs and other variables A, B, and C. Each Person has > multiple values in A, B, and C. What I am trying to do is 1) selecting a > maximum value of B within same ID, and 2) making a new d