Skip to content

Instantly share code, notes, and snippets.

Created March 8, 2018 19:39
What would you like to do?
Blog on Location Analysis: Script for multilocation report
# Section 1. Multiple Journey Days
# this section generates a report of the to,from and days that have more
# journeys than days travelled (i.e. there was on average more than 1 trip per day)
# select the days/to/from that have more journeys than journey days
out.m <- which(journey.count.x>pred.journey.x,
# select the journey count for the multi-trip dates
journey.count <- journey.count.x[journey.count.x>pred.journey.x]
# select the journey days for the multi-trip dates
journey.days <- pred.journey.x[journey.count.x>pred.journey.x]
# make a ratio of journey/journey days
ratio.v <- round(large.journey.count.v / large.journey.days.v,2)
# append the journeys, journey days, ratio as columns to
# the from, to, day information
out.m <- cbind(out.m,journey.count,journey.days,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment