I have four large vectors of unequal length. Below I am providing a toy dataset similar to my original dataset:
a <- c(1021.923, 3491.31, 102.3, 12019.11, 879.2, 583.1)
b <- c(21,32,523,123.1,123.4545,12345,95.434, 879.25, 1021.9,11,12,662)
c <- c(52,21,1021.9288,12019.12, 879.1)
d <- c(432.432,23466.3,45435,3456,123,6688,1021.95)
Is there a way to compare all of these vectors one by one with an allowed threshold of ±0.5 for the match? In other words, I want to report the numbers that are common among all four vectors while allowing a drift of 0.5.
In the case of the toy dataset above, the final answer is:
Match1
a 1021.923
b 1021.900
c 1021.929
d 1021.950
I understand that this is possible for two vectors, but how can I do it for 4 vectors?
RELATED