Description Usage Arguments Value Author(s) See Also Examples
This function takes the d.raw
data object (trip_duration_counts.txt) or the d.raw.42
data object (trip_durations_counts_sub_42.txt)
and parses the complex character string in the third column into a long form data set with date information. This function takes a while to run on the raw
trip duration data, more cores are better.
1 | parse.longform(d, n.cores)
|
d |
raw text file containing trip duration data |
n.cores |
number cores to use when parallel computing |
a dataframe with the district IDs and names of the origin and destination districts, counts of each trip duration and detailed date information
John Giles
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.subsamp()
,
get.xy.counts()
,
mob.data.array()
1 2 3 4 5 6 7 8 9 10 11 | # process trip length data into long form data set with dates
t <- Sys.time()
tmp <- parse.longform(
d=read.table('BeyondCommuting2/trip_lengths/trip_duration_counts.txt', header = FALSE, sep = "|"),
n.cores=6
)
head(tmp)
write.csv(tmp, file="BeyondCommuting2/trip_lengths/trip_durations_longform.csv", row.names=FALSE)
Sys.time() - t
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.