Hello I have a data frame, and would like to return values that are duplicated in every column. For instance, I have this data frame:
df <- data.frame(
A = c(1,0,9,6,0),
B = c(0,1,0,0,0),
C = c(8,0,1,4,0),
D = c(3,0,4,1,0),
E = c(0,0,0,0,1)
)
df
A B C D E
1 1 0 8 3 0
2 0 1 0 0 0
3 9 0 1 4 0
4 6 0 4 1 0
5 0 0 0 0 1
The computer would then return 0 and 1 because these are the only values that are in every column.
Thanks!