I have one problem.
Vector A is the query, Vector B is the ref.
I want to see which value of A is the closest to one of the B value.
Both vectors are ordered.
INPUT
A = c(1, 1.2, 4, 8, 9, 10, 30)
B = c(0.1, 3.9)
OUTPUT
min_diff_value = 0.1
min_value_A = 4
min_value_B = 3.9 (optionnal)
I want to know if there may be a trick to perform this without time-consuming loop?
Thank you.