R(week 13_2)

install.packages('nycflights13')
library(dplyr)
library(utils)
library(nycflights13)
head(flights)

flights_Month1_Day1 <- filter(flights, month == 1, day == 1)
flights_Month1_Day1

dim(flights_Month1_Day1)

flights_Month1and2 <- filter(flights, month == 1 | month == 2)
flights_Month1and2
dim(flights_Month1and2)

arrange(flights, year, month, day)
arrange(flights, desc(dep_delay))

select(flights, year, month, day)
flight2 <- select(flights, year:day, dep_delay, arr_delay, distance, air_time)
flight2

arrange(flight2, desc(dep_delay))

mutate(flight2, sped = distance/air_time*60)

    

posted @ 2021-05-24 18:06  sinEagle  阅读(34)  评论(0编辑  收藏  举报