לאה פּאַסטעך - 1 year ago 63

R Question

I need help! I have a list of points (mydata X, Y = latitude, longitude) wich I want to set in relation towards a single Point (for example 287, 347). I just want to measure (and polt) the distance between the list of points towards this single point of reference. But I don't get it. I tried PCA, but there I can't set my specific point of reference.

Does anyone has an idea how to do this?

mydata:

`X,Y`

260,204

409,208

260,60

272,181

367,257

315,208

381,294

66,333

246,220

330,207

342,304

...

Answer Source

Using the distance formula, this is a trivial calculation:

```
mydata$distance = sqrt((mydata$X - 287)^2 + (mydata$Y - 347)^2)
```

I'm not sure what sort of plot you would like of distance - perhaps a histogram?

```
hist(mydata$distance)
```