Timeline for Randomly sample existing points from within polygons in SF | R
Current License: CC BY-SA 4.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 8, 2019 at 0:58 | vote | accept | Scransom | ||
Jul 5, 2019 at 6:46 | history | edited | Scransom | CC BY-SA 4.0 |
expanded answer
|
Jul 5, 2019 at 6:40 | history | edited | Scransom | CC BY-SA 4.0 |
expanded answer
|
Jul 5, 2019 at 6:37 | comment | added | Scransom | @Spacedman you are quite correct and for posterity I will add in my fix for this | |
Jul 5, 2019 at 6:24 | comment | added | Spacedman |
This will fail badly if there is only one point in a polygon, because sample(3:5,1) samples from 3,4,5, and sample(4:5,1) samples from 4,5, but if you do sample(5,1) you get a sample from 1,2,3,4,5, and not 5 every time. See ?sample and use a safer sampling function such as resample defined in the help page.
|
|
Jul 5, 2019 at 2:27 | history | answered | Scransom | CC BY-SA 4.0 |