Description Usage Arguments Value Examples
View source: R/sample-people.R
Sample appropriate indices from household PUMS
1 2 | sample_households(method, n_house, pums_h, pums_p = NULL, puma_id = NULL,
place_id = NULL, marginals = NULL)
|
method |
character indicating the method for sampling |
n_house |
numeric indicating the number of households to sample |
pums_h |
dataframe of the households we are sampling from |
pums_p |
optionally include a dataframe of agents |
puma_id |
vector indicating which specific puma in PUMS we are sampling from, if any |
place_id |
unique code identifying the place |
marginals |
optionally used for IPF or MM sampling |
numeric with the indicies of the household PUMS to sample
1 2 3 4 5 6 7 8 9 10 | data("tartanville")
example_place_id <- tartanville$pop_table$place_id[1]
example_puma_id <- tartanville$pop_table$puma_id[1]
example_n_house <- tartanville$pop_table$n_house[1]
sample_households(method = "uniform",
pums_h = tartanville$pums_h,
pums_p = tartanville$pums_p,
n_house = example_n_house,
place_id = example_place_id,
puma_id = example_puma_id)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.