Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Bhargav-Rao
Created April 19, 2015 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bhargav-Rao/8ebaf5e1977135b6d361 to your computer and use it in GitHub Desktop.
Save Bhargav-Rao/8ebaf5e1977135b6d361 to your computer and use it in GitHub Desktop.
library("nycflights13")
library("dplyr")
vect <- select(flights, distance, air_time)
avrg <- mutate(vect, average_speed = distance / air_time * 60)
sorted_avrg <- na.omit(avrg[order(avrg$average_speed, decreasing = TRUE),])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment