Description Usage Arguments Value Author(s) See Also Examples
The get.distance.counts
function calculates a matrix or long-form dataframe of trip distance counts for a temporal
interval t
given an origin a
. Only takes origin district because it uses distances across all destinations.
1 2 3 4 5 6 7 8 | get.distance.counts(
a,
t,
d,
type = "matrix",
distID = districtIDs,
n.cores = NULL
)
|
a |
origin district (can take integer ID or character name) |
t |
character string indicating the temporal interval the count trip distances (e.g. 'month', 'week', 'doy') |
d |
longform mobility data, expects |
type |
return a 'matrix' or a 'dataframe' with counts in longform, default = 'matrix' |
distID |
district IDs and names, expects |
n.cores |
number cores to use when parallel computing (default = NULL, which uses half available cores) |
matrix or dataframe
John Giles
Other data synthesis:
calc.prop.tot.trips()
,
calc.route.type()
,
calc.samp.size()
,
get.crossdist()
,
get.distance.class()
,
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()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Distribution of trip distances that originate from Windhoek East (42)
data(d.42) # same as ./BeyondCommuting2/trip_lengths/trip_durations_longform_metadata_42.csv
data(districtIDs) # same as NamNames.csv
orig <- "Windhoek East"
m <- get.distance.counts(a=orig, t='month', d=d.42, n.cores=4)
see(m)
lattice::wireframe(m[,1:50],
xlab = "Month", ylab = "Distance", zlab='Freq',
drape = T, colorkey = F,
light.source = c(10,0,10),
col.regions = colorRampPalette(c("blue", "red"))(100),
screen = list(z = 230, x = -60))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.