I have two sets, A and B, both containing positions of some particles. What I want to do is the following:
For each element a in A,
Calculate the minimum distance between a and the elements of B.
Put these distances in to a list and return.
I know how to do this with looks, but I don't know how to do it in a fast way using data.table syntax.