I want to generate 5 pairs of random points per each stratum. I have 4 strata that represent different rock types. For each rock type i want to generate 5 random points and to each random point I want to assign its respective pair at 10 meters distance (but it should still belong to the same stratum/category of rocks). So, altogether there should be 20 original random points and 20 additional (paired ones).
I have tried using sampling::strata
(R package is called sampling
and to get random points stratified per category the function strata
is appropriate to use). See the code below. My sf object (data) is called selected_rows
and the column with categories/strata is Rock_name
. The size is 5 points per stratum.
units <- sampling::strata(
selected_rows, stratanames = "Rock_name", size = n_s[stratum], method = "srswr")
points = getdata(selected_rows, units) %>% st_as_sf()
My issue is now that I do not get coordinates of the random points rather the geometry is multi-polygon. I suppose from the strata. I would like to have coordinates of each of the 20 generated points so I can generate their respective pairs at 10 meters distance with random azimuth or st_buffer.
Does anyone know if it is possible to get the coordinates of each of the randomly generated points per stratum?
I was following the instructions from Dick Brus new book on spatial sampling. See the screenshot below.