I have the following dataframe (df1):
ID someText PSM OtherValues ABC c 2 qwe CCC v 3 wer DDD b 56 ert EEE m 78 yu FFF
This is super easy using the plyr package:
plyr
library(plyr) ddply(df1, .(ID), summarize, Sum=sum(PSM))