The 4th column is my desired column. Video,Webinar,Meeting,Conference are the 4 type of activities that the different customers(names) can engage in. You can see,in a given row,
Here you go:
setcolorder(dt, c("Name", "Webinar", "Meeting", "Conference", "Video", "NextStep"))
dt[, NextStepNew:=apply(dt, 1, function(x) paste0(names(x)[x==0], collapse=","))][]
Name Webinar Meeting Conference Video NextStep NextStepNew
1: John 0 0 0 1 Webinar,Meeting,Conference Webinar,Meeting,Conference
2: John 1 0 0 1 Meeting,Conference Meeting,Conference
3: John 1 1 0 1 Conference Conference
4: Tom 0 1 0 0 Webinar,Conference,Video Webinar,Conference,Video
5: Tom 0 1 1 0 Webinar,Video Webinar,Video
6: Kyle 0 0 1 0 Webinar,Meeting,Video Webinar,Meeting,Video