[R-sig-Geo] random sampling along contour

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Wed Oct 9 14:18:17 CEST 2013


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