Testing for multiple identical columns in R
问题 Is there a short way to test for identity over multiple columns? For example, over this input data=data.table(one=c(1,2,3,4), two=c(7,8,9,10), three=c(1,2,3,4), four=c(1,2,3,4) ) Is there something that would return all the columns that are identical to data$one? Something like allcolumnsidentity(data$one, data) # compares all columns with respect to data$one Should return (TRUE, FALSE, TRUE, TRUE) since data$three and data$four are identical to data$one. I saw the identical() and comapre()