Creating new column based on multiple possible cell possibilities across several columns
问题 data[, allkneePR := Reduce(`|`, lapply(.SD, `==`, "0082")), .SDcols=PR1:PR3] Hey, I'm trying to look for different diagnoses c("0082", "0083", "0084") across a range of rows and columns in data.table (the dataset is huge). If one of the values is "0082" or "0083" or "0084" in any of the columns PR1:PR3 I want another column that indicates true. Right now this works with the above code, but I am trying to add in multiple diagnoses, not just "0082". I tried the any() function which doesn't work