get.subsamp: Find the subset of districts which have a minumim number of...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/hmob_funcs.R

Description

This function takes the output from a the mob.data.array function and finds the largest subset of locations (districts) that have a minumum number of observations for all ij routes. The subset is found by sequentially removing the location with the largest number of routes below the defined threshold (min.samp) until all locations contain at least min.samp number of observations for each route.

Usage

1
get.subsamp(x, min.locations, min.samp)

Arguments

x

a three dimensional array produced by the mob.data.array function

min.locations

minimum number of locations (rows and columns) to keep

min.samp

minimum sample size

Value

a three dimensional array containing the subset of x

Author(s)

John Giles

See Also

Other data synthesis: calc.prop.tot.trips(), calc.route.type(), calc.samp.size(), get.crossdist(), get.distance.class(), get.distance.counts(), get.distance.matrix(), get.district.names.xy(), get.district.pop(), get.duration.counts(), get.holidays(), get.sparse.mob.matrix(), get.stay.data(), get.xy.counts(), mob.data.array(), parse.longform()

Examples

1
2
3
4
5
6
load('./data/duration_data_arrays_3day_full.Rdata') # y.month, y.route, y.pop 

subsamp <- get.subsamp(y.route, min.locations=30, min.samp=10)

district.subset <- dimnames(subsamp)$origin
trip.map(as.numeric(district.subset))

gilesjohnr/hmob documentation built on Aug. 8, 2020, 1:26 a.m.