This question already has an answer here:
So after looking at various Questions asked here on stackoverflow I'm still not able to wrap my head around the dist function in R or maybe even a distance matrix in general.
So I have two dataframes with xy-coordinates.
df1 <- data.frame(x = runif(3,0,50), y = runif(3,0,50))
df2 <- data.frame(x = runif(20,0,50), y = runif(20,0,50))
I want to iterate through the first dataframe and for each point/row I want to check the distance to all the points in the second df. This is probably extremely easy to do and I am sorry and ashamed that I am asking this, but I'm trying for hours now. Any help is appreciated!
the pakcage
proxy
lets you calcualte distances between rows of matrices in addition to providing many more distance metrics.