Blog on Location Analysis: Script for multilocation report
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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, arr.in=TRUE) | |
# 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, | |
ratio.v) | |
out.m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment