Elegant way to solve ddply task with aggregate (hoping for better performance)
问题 I would like to aggregate a data.frame by an identifier variable called ensg . The data frame looks like this: chromosome probeset ensg symbol XXA_00 XXA_36 XXB_00 1 X 4938842 ENSMUSG00000000003 Pbsn 4.796123 4.737717 5.326664 I want to compute the mean for each numeric column over rows with same ensg value. The problem here is that I would like to leave the other identity variables chromosome and symbol untouched as they are also the same for same ensg . In the end I would like to have a