get.distance.class: Add distance between origin and destination districts to long...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/hmob_funcs.R

Description

This function takes output from the parse.long.form function and appends columns containing distance between origin and destination districts. This function also adds two columns indicating the commuting classification of the travel:

  1. rcl_same_adm1 = whether trip was within same admin unit

  2. cl_contig = whether trip was within same, to adjacent, or to non-adjacent admin unit

Usage

1

Arguments

a

expects output from parse.long.form (trip_durations_longform.csv)

b

expects data object d.meta.3 (route_classification.csv)

Value

dataframe

Author(s)

John Giles

See Also

Other data synthesis: calc.prop.tot.trips(), calc.route.type(), calc.samp.size(), get.crossdist(), 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.subsamp(), get.xy.counts(), mob.data.array(), parse.longform()

Examples

1
2
3
4
5
6
# Add district population sizes and route classifications 
tmp <- get.distance.class(
     a=read.csv("BeyondCommuting2/trip_lengths/trip_durations_longform.csv"),
     b=read.csv("BeyondCommuting2/data/route_classification.csv")
)
head(tmp)

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