Primeiro, ações que definem o escopo de nossos dados:
Primeiro, ações que definem o escopo de nossos dados:
flights
flights %>% select(air_time)
flights %>% select(air_time)
flights %>% slice(1:2)
flights %>% slice(1:2)
flights %>% filter(origin=="JFK")
flights %>% filter(origin=="JFK")
flights %>% rename("airline"="carrier")
flights %>% rename("airline"="carrier")
Segundo, ações para calcular a medida / estatística que precisamos
flights
flights %>% mutate(air_time=round(air_time/60,3))
flights %>% mutate(air_time=round(air_time/60,3))
flights %>% summarize(avg_distance=mean(distance,na.rm=TRUE))
flights %>% summarize(avg_distance=mean(distance,na.rm=TRUE))
flights %>% tally()
flights %>% group_by(carrier) %>% summarize(avg_distance=mean(distance,na.rm=TRUE))
flights %>% group_by(carrier) %>% summarize(avg_distance=mean(distance,na.rm=TRUE))