Created
December 17, 2015 13:20
-
-
Save anirudhjayaraman/60e58f05d725c4262161 to your computer and use it in GitHub Desktop.
Helper functions used along with select()
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
# Helper functions used with dplyr | |
# Print out a tbl containing just ArrDelay and DepDelay | |
select(hflights, ArrDelay, DepDelay) | |
# Use a combination of helper functions and variable names to print out | |
# only the UniqueCarrier, FlightNum, TailNum, Cancelled, and CancellationCode | |
# columns of hflights | |
select(hflights, UniqueCarrier, FlightNum, contains("Tail"), contains("Cancel")) | |
# Find the most concise way to return the following columns with select and its | |
# helper functions: DepTime, ArrTime, ActualElapsedTime, AirTime, ArrDelay, | |
# DepDelay. Use only helper functions | |
select(hflights, ends_with("Time"), ends_with("Delay")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment