Professional Documents
Culture Documents
Tidyverse AssigmentMishalM
Tidyverse AssigmentMishalM
cat(" Number of rows>> ", dim(a)[1], "\n Number of columns>> ", dim(a)[2])
(ii) How many different carriers are listed in the table (print a table with
distinct carrier names)?
a %>% distinct(UniqueCarrier)
a %>% distinct(UniqueCarrier) %>% nrow() #totally 15
(iii) Which and how many airports were involved? Consider both origin and
destination
airports!
a %>% distinct(Origin)
a %>% distinct(Dest)
union(unique(hflights$Origin), unique(hflights$Dest))
(v) (A) Produce a table where statistics for each carrier is shown:
(a) number of flights per carrier
(b) total distance own in miles per carrier
(c) total actual elapsed time in hours per carrier
(d) total air time in hours per carrier
(e) mean distance per flight for each carrier
(f) mean actual elapsed time in hours per flight for each carrier
(g) mean air time in hours per flight for each carrier
#the distance was increasing till june month and decreased after june