Perhaps, dear reader, you are too young to remember that before, the only way to request a particular transport service such as a taxi was to raise a hand to make a signal to an available driver, who upon seeing you would stop if he was not busy to transport you to your destination, not without first asking how far you go, to assess whether or not to take the task. And without stars with which to let the driver know your satisfaction as a passenger with the trip.

Just seven years ago, at least in Mexico before Uber’s arrival, that’s how things were. The arrival of the most famous Mobility-as-a-service App in the world changed many of our habits, opening the market, and great opportunities for many.

Rarely do we stop for a moment to analyze our consumption habits and answer questions such as How much have I spent? What places do I go to on Uber are the most frequent? With the distance traveled until today, could I have reached China? Uber, like many other applications, offers you the possibility of requesting a copy of your data, which includes the complete history of your trips. We will take advantage of this to analyze and visualize some interesting personal data.

Where to get a copy of my data?

You can request your copy from this URL which is the section of the official Uber help center and that talks about it. At the bottom of that page, you have to click on the link that says “Download your data”

Image for post

Clicking will redirect you to a new window to log in with your account. Also, Uber to make sure that you are requesting the data will send you an SMS to the phone number associated with your account, with a 4-digit code that you must enter to authenticate yourself. Once successfully authenticated you will now find a new button with the title “Request data” to which you must click.

Image for post

Image for post

Image for post

Image for post

Screenshots: Verification code received in SMS and access to request a copy of personal data on Uber

By clicking, Uber will be sending you an email notifying you that a copy of your data is being prepared and will be sent to you as requested. Approximately 12 to 24 hours later, a new email should be arriving inviting you to log in again to download your copy, in .zip format.

Image for post

Screenshot: Email with URL to download a copy of personal data on Uber

Data Reading

By unzipping the .zip file you will find a structure of files and folders. We are interested in the CSV file named “trips_data.csv”, contained in the “Rider” folder. This CSV file contains the data of your trips made since your first trip, until your last trip today. It will provide you with information such as the type of product (UberX VIP, UberX, Uber Eats, etc.), order status (Completed, Canceled, etc.), the fee paid, dates, latitudes and longitudes, distance traveled, among other data.

Image for post

Now, you can create a new script in R to import and read the CSV file and work it to analyze and visualize some interesting data.

# REQUIRED LIBRARIES
library(dygraphs)
library(tidyquant)
library(tidyverse)
library(dygraphs)
library(plyr)
library(quantmod)
library(ggthemes)
library(ggplot2)
library(RColorBrewer)
library(sp)
library(ggmap)
library(lubridate)
library(leaflet)
library(plotly)
library(dplyr)
library(mgsub)
library(xts)
# DATA READING
myTrips <- read.csv("my_trips_uber_history.csv", stringsAsFactors = FALSE)
myTrips$Request.Time <- as.Date(myTrips$Request.Time, "%Y-%m-%d")
myTrips$Year <- as.Date(cut(myTrips$Request.Time, breaks="month"))

#technology #uber #data-analysis #data-visualization #programming #data analysis

How to Analyze and Visualize Your Personal Data History
1.30 GEEK