Show Menu

Data manipulation in R : dplyr Cheat Sheet by

r     dplyr     datamanipulation


Used to select specific columns from a data set.

To select a column -
Use the "­:" sign to select a range of columns
Type in the specific column names to select indivi­dually
Use the "­-" operator to exclude a column or a range of columns
#Select individal columns
hflig­hts­_mu­ltiple <- select­(hf­lights, ArrTim­e,A­irT­ime­,Ta­xiIn)

#Shortcut to select a range of columns
hflig­hts­_range <- select­(hf­lig­hts­,Ye­ar:­Day­OfW­eek­,Ar­rTi­me:­Air­Time)

#Exclude a set of columns
hflig­hts­_su­btract <- select­(hf­lights, -(DayO­fWe­ek:­Fli­ght­Num)

Helper Functions

To search for column names, instead of typing each one manually or specifying range - we can use helper functions. These functions help us in making our work easier.

Common helper functions

Download the Data manipulation in R : dplyr Cheat Sheet

1 Page

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!



No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          iGraph Cheat Sheet

          More Cheat Sheets by shanly3011