Skip to content

Instantly share code, notes, and snippets.

@spsaaibi
Last active December 10, 2015 13:50
Show Gist options
  • Save spsaaibi/ece4f4630ad4187bbc55 to your computer and use it in GitHub Desktop.
Save spsaaibi/ece4f4630ad4187bbc55 to your computer and use it in GitHub Desktop.
read-process-taxi-data
###---
### Sample Data Preparation
###---
#install.packages("dplyr")
#install.packages("readr")
library(dplyr)
library(readr)
# read dataset
data <- read_csv("http://www.geolink.pt/ecmlpkdd2015-challenge/data/Porto_taxi_data_training.csv")
n_taxis_call_type <-
data %>%
group_by(CALL_TYPE,TAXI_ID) %>%
summarise( N_TAXIS_CALL_TYPE = n()) %>%
select(N_TAXIS_CALL_TYPE, CALL_TYPE)
n_taxis_call_type <-
n_taxis_call_type %>%
summarise(N_TAXIS_CALL_TYPE = sum(N_TAXIS_CALL_TYPE))
n_taxis_call_type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment