Skip to content
Prev 363428 / 398502 Next

remove rows based on row mean

oh I forgot I renamed sm.

dt = sm
library(data.table)
setDT(dt)
op = function(s){
mean0 = apply(s, 1, mean)
ret = s[which.max(mean0)]
ret$mean = mean0
ret
}
max_row = dt[, op(.SD), by = "Gene"]


Thanks,
Jeremiah

On Thu, Aug 18, 2016 at 3:21 PM, jeremiah rounds <roundsjeremiah at gmail.com>
wrote: