[Solved] sum lines with similar substring [closed]
We could match the substring starting from _ to the end of the string (.*$) in ‘IsomiR’ column and replace with ” using sub. We use that as the grouping variable. If we are doing this with dplyr, the summarise_each can be used for summing multiple columns. library(dplyr) df1 %>% group_by(IsomiR= sub(‘_.*$’, ”, IsomiR)) %>% … Read more