```
library(sf)
#> Linking to GEOS 3.6.1, GDAL 2.2.3, PROJ 4.9.3
set.seed(15)
X=7.5
Y=7.5
f = function(){
a = runif(10,1,10)
return( a=as.integer(a))
}
onlineloc=data.frame(x=f(),y=f())
store=data.frame(X,Y)
plot(onlineloc,main="Online and instore customer loc",col=" red")
points(X,Y,pch=15)
```

```
p = st_sfc(st_point(c(7.5,7.5)))
q=st_sfc(onlineloc)
#> Error in vapply(lst, class, rep(NA_character_, 3)): values must be length 3,
#> but FUN(X[[1]]) result is length 1
st_distance(p, q )
#> Error in UseMethod("st_geometry"): no applicable method for 'st_geometry' applied to an object of class "function"
st_distance(q, p, by_element = TRUE)
#> Error in UseMethod("st_geometry"): no applicable method for 'st_geometry' applied to an object of class "function"
```

^{Created on 2019-09-12 by the reprex package (v0.3.0)}

why it is occuring