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:
- Make sure RStudio (or just R) is installed on your machine.
- Open an R environment.
- Install/load the
googlewaylibrary. - Get a Google Maps API Key from https://developers.google.com/maps/documentation/javascript/get-api-key, and put it in the script.
- Tweak the dates/times for which you'd like to measure the commutes, if you'd like.
- Load up the function in this script, as well as a data frame with the names and addresses of your coworkers.
- Get a list of the office locations for which you'd like to calculate commutes.
- 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.