estimate_distance <- function(x, y, df.x, df.y){
return(
t(spDists(
SpatialPoints(coords = data.frame(x = x, y = y), proj4string=CRS("+proj=longlat +datum=WGS84")),
SpatialPoints(coords = data.frame(x = df.x, y = df.y), proj4string=CRS("+proj=longlat +datum=WGS84")),
longlat=T))
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.