library(dplyr)
library(plotly)
nytaxi <- read.csv("nyc_tlc_yellow_trips_2018_subset_1.csv") %>%
transmute(yearmonth = format(as.Date(pickup_datetime), "%Y%m"),
passenger_count) %>%
group_by(yearmonth) %>% summarise(Passenger_Count = sum(passenger_count))
head(nytaxi)
# A tibble: 6 x 2 yearmonth Passenger_Count <chr> <int> 1 201801 1228 2 201802 1248 3 201803 2722 4 201804 1249 5 201805 1324 6 201806 1225