[R-sig-Geo] random sampling along contour
Seth Bigelow
seth at swbigelow.net
Wed Oct 9 15:01:10 CEST 2013
Barry,
I do mean exactly what you have stated, i.e., "plus or minus up to 50m
either side of the points created by your plot, but along the contour line?
In other words, I go to each of those points on your plot, choose a
runif(1,-50,50) and traverse that distance on the contour line to get my
sampling point?"
In my real-world application, there do not seem to be either of the 'edge'
issues you raise, since the flank of the mountain I am sampling is not
highly dissected. But if the contour line is a loop, it would be fine to 'go
around', or just throw an 'NA'. Similarly, if the contour line ends, an 'NA'
would be ok.
Thanks for thinking about this!
-Seth Bigelow
-----Original Message-----
From: b.rowlingson at gmail.com [mailto:b.rowlingson at gmail.com] On Behalf Of
Barry Rowlingson
Sent: Wednesday, October 09, 2013 8:18 AM
To: Seth Bigelow
Cc: r-sig-geo at r-project.org
Subject: Re: [R-sig-Geo] random sampling along contour
On Wed, Oct 9, 2013 at 12:32 PM, Seth Bigelow <seth at swbigelow.net> wrote:
> Hello all:
>
>
>
> I wish to place sampling plots at regular elevation intervals up a
mountain.
> Plot centers should be placed at random within a 100 m wide transect
> along the contour. Can anyone suggest an efficient way of doing this?
> Code below places plots on a single transect on the volcano dataset,
> but does not do the 'along the contour' randomization.
I'm not clear what you mean here, the plot is a big help though and
+1 for that.
By "a 100m wide transect along the contour" do you mean plus or minus up to
50m either side of the points created by your plot, but along the contour
line? In other words, I go to each of those points on your plot, choose a
runif(1,-50,50) and traverse that distance on the contour line to get my
sampling point?
What if the contour line at that point is a loop less than 100m long?
Do I go around? The other edge case is literally an edge case - when the
contour line hits the edge...
Barry
More information about the R-sig-Geo
mailing list