Fairly novice R user, and I'm sure there's an easy solution for this - but I can't find it. I have a data frame with a series of spatial coordinates, as well as a host of other attributes. Many of the spatial coordinates are the exact same - and I would like to add a set amount of noise to them, so that I can keep them within a certain radius - in this case 0.4 meters, or 40 centimeters while also keeping track of their associated attributes.
I am essentially looking for an R version of this question: https://gis.stackexchange.com/questions/35479/adding-noise-to-overlapping-x-y-coordinates-so-no-longer-in-exact-same-place
... because when I follow the directions for the answer to this question using ArcGIS - I get a series of random points but I lose the attributes associated with those points, and I can't easily find a way to match them back up, especially because so many of the points are close together. Ordering the attribute table of the newly generated random points by descending latitude or longitude and then rejoining it to the original table still results in mismatched mistakes because of how closely the points are distributed prior to the jitter.
Is there a way to use the jitter function in R or something similar and specify the radius in a spatial context (e.g. 40 cm) that the spatial coordinates are randomly distributed within? I don't understand how to manipulate the factor and amount argument in order to get my desired output.
Thank you!
Aucun commentaire:
Enregistrer un commentaire