I am hoping to build a matrix of 'fake' coordinates (i.e., they could be anywhere on Earth) based on their distances (in km or m) from one another.
I have a data frame containing distances between locations.
dist_df<- data.frame(site1=c("a","b","c","d"),
site2=c("b","c","d","a"),
distance = c(222.1, 672.4, 45.2, 65.4))
However, the actual coordinates have obstructions between them. Thus, I have circumvented the obstructions with another bit of code to obtain a least-cost distance. To run a series of later functions I require lat/long. I figured the easiest way to do this was to generate 'fake' coordinates based on their relative least-cost distances.
I am hoping to obtain something like the following:
coordinates_sites<-data.frame(site=c("a","b","c","d"),
lat=c(34.5332,32.1232,30.4232,30.4232),
long=c(-120.2222,-125.4422,-123.3512,-122.4232))
Any thoughts on the best way to do this? Many thanks in advance!