Last active
February 16, 2016 05:37
-
-
Save sriyoda/be1216082c518d2d2343 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Showing transformation for 2007 only, this was done 4 times for years 2004-2007 | |
f2007 <- read.csv("2007.csv", stringsAsFactors = F) | |
f2007 <- f2007[,c(1,2,3,4,9)] #subsetting | |
f2007$date <- paste(f2007$Year, f2007$Month, f2007$DayofMonth, sep='-') #creating Date Column | |
f2007_1 <- f2007 %>% group_by(date) %>% summarise(count = n()) #creating a count column of total flights per day | |
f2007_2 <- f2007 %>% group_by(UniqueCarrier, date) %>% summarise(count = n()) #creating count column of total flights per day by Carrier | |
flights_by_year <- rbind(f2007_2,f2006_2,f2005_2,f2004_2) #summarising count by carrier | |
f2007_carrier <- group_by(f2007_2, UniqueCarrier, Month) %>% summarise(count=n()) #summarising count by Carrier |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment