Suppose you have a data frame called data with two identical columns:
A B 1 1 2 2 3 3 4 4
How can I check if these two columns are identica
You could use all():
> data <- data.frame(A=c(1,2,3,4), B=c(1,2,3,4)) > all(data$A == data$B) [1] TRUE