st_sample_geotools | R Documentation |
st_sample_geotools
st_sample_geotools(
geodata,
n,
fraction = NULL,
weight_var,
type = "random",
iter = 9,
...
)
geodata |
|
n |
number of features to sample |
fraction |
fraction of features to sample |
weight_var |
(optional) variable in |
type |
passed to |
iter |
passed to |
... |
reserved for future use |
county_geodata <- TIGER2015::TIGER2015_SFBA_counties %>% with_county_populations()
county_sample <- county_geodata %>% st_sample(n = 1000, weight_var = "county_pop_total")
tract_geodata <- TIGER2015::TIGER2015_SFBA_tracts %>% filter(str_detect(GEOID, "^06095")) %>% with_tract_populations()
tract_sample <- tract_geodata %>% st_sample(n = 1000, weight_var = "tract_pop_total")
ALA_block_geodata <- TIGER2015::TIGER2015_SFBA_blocks %>% filter(str_detect(GEOID10, "^06001")) %>% with_block_populations()
ALA_block_sample <- ALA_block_geodata %>% dplyr::select(block_id, block_pop_total) %>% st_sample(frac = 0.1, weight_var = "block_pop_total")
mapview::mapview(ALA_block_sample, cex = 1, color = NULL)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.