Mutate
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
# Add the new variable ActualGroundTime to a copy of hflights and save the result as g1. | |
g1 <- mutate(hflights, ActualGroundTime = ActualElapsedTime - AirTime) | |
# Add the new variable GroundTime to a g1. Save the result as g2. | |
g2 <- mutate(g1, GroundTime = TaxiIn + TaxiOut) | |
# Add the new variable AverageSpeed to g2. Save the result as g3. | |
g3 <- mutate(g2, AverageSpeed = Distance / AirTime * 60) | |
# Print out g3 | |
g3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment