I have data like this:

```
 library(data.table)
 dtorig <- data.table(x=1:100,lat=(sample(c(800:900),100))/100, lon=(sample(c(3800:3900),100))/100)

```

I'd like to get the location of rows in dtorig that are farthest away from one another. My attempt (which doesn't work) is below:

```
 ###NOT WORK
  library(geosphere)
  extremep <- chull(dtorig[, c(3,2)])
  extremepoints <- dtorig[extremep,]
  wmax <- sapply(1:NROW(extremepoints), function(i) which.max(distm(extremepoints[i, c(3,2)],fun=distHaversine)))

```