My goal is to sum all values in columns that start with the prefix skill_ in a data.table. I would prefer a solution using data.table
skill_
data.table
Here is a dplyr solution:
library(dplyr) DT %>% mutate(count = DT %>% select(starts_with("skill_")) %>% rowSums())