ic3 - 1 month ago 9

R Question

I'm newby to R. I've a vector with distances

`dist <- c(1, 3, 5, 20, 34)`

Is there a function that given a point d calculates the shortest distance to an existing point ?

`distance <- sDist(7.5, dist)`

that returns 2.5 ( 7.5 - 5 ).