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
Using data.table
setDT(df1)[, lapply(.SD, sum) , by = ID, .SDcols = "PSM" ]