Description Usage Arguments Value Examples
View source: R/sample-locations.R
Generic sampling locations function
1 2 | sample_locations(method, place_id, n_house, shapefile, noise = 0.001,
shapefile_id = NULL)
|
method |
character vector either "uniform" or "roads" determining how we are sampling locations |
place_id |
numeric specifiying the ID of the region we are subsampling |
n_house |
numeric indicating the number of households |
shapefile |
sp class with all of the locations for each place id. Note that this is a list with two shapefiles if me |
noise |
the standard deviation of how much we jitter the road locations in each direction (only if method is "roads") |
shapefile_id |
optionally include a shapefile id for subsetting shapefile |
SpatialPoints object with coordinates for the n households
1 2 3 4 5 6 7 8 9 | 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_locations(method = "uniform",
shapefile = tartanville$shapefile,
n_house = example_n_house,
place_id = example_place_id)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.