sample_random | R Documentation |
sample_random()
generates a simple random sample of a set of survey units.
sample_random(units, n = NULL, fraction = NULL, column = "sample")
units |
An |
n |
Number of units to sample. Either |
fraction |
Fraction of units to sample. |
column |
Name of the column to be added. Default: "sample". |
units
with an additional boolean column describing the sample.
library(magrittr)
library(ggplot2)
rpolygon() %>%
quadrats(n = c(10, 10)) %>%
sample_random(n = 50) %>%
ggplot(aes(fill = sample)) + geom_sf()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.