sample_locations: Generic sampling locations function

Description Usage Arguments Value Examples

View source: R/sample-locations.R

Description

Generic sampling locations function

Usage

1
2
sample_locations(method, place_id, n_house, shapefile, noise = 0.001,
  shapefile_id = NULL)

Arguments

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

Value

SpatialPoints object with coordinates for the n households

Examples

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)
                  

spew documentation built on Nov. 17, 2017, 7:36 a.m.