Skip to content

This script pings Google for directions between two points and extracts the amount of time it will take to travel, via car and mass transit, between those two points.

Notifications You must be signed in to change notification settings

wearemolecule/CommuteTimes

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

CommuteTimes

This is a fork of ZacharyST/CommuteTimes, tweaked for the purpose of determining which of a set of potential new offices spaces for our team, has the shortest commute time. To use it:

  1. Make sure RStudio (or just R) is installed on your machine.
  2. Open an R environment.
  3. Install/load the googleway library.
  4. Get a Google Maps API Key from https://developers.google.com/maps/documentation/javascript/get-api-key, and put it in the script.
  5. Tweak the dates/times for which you'd like to measure the commutes, if you'd like.
  6. Load up the function in this script, as well as a data frame with the names and addresses of your coworkers.
  7. Get a list of the office locations for which you'd like to calculate commutes.
  8. Run the script, using something like this:
# Assumes e is a data frame, with the names/addresses of your coworkers, manually specifies office address.
results <- mapply(processDirections, name=e$First, origin=e$Address, destination='123 Any St, Houston, TX 77002')
write.table(results, "~/Desktop/commutes.csv", sep=",")

Note: if you're using an OS other than macOS, you may need to tweak the Time Zone names in the script.

About

This script pings Google for directions between two points and extracts the amount of time it will take to travel, via car and mass transit, between those two points.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • R 100.0%