Data Handling

Filter rows, pick columns, sort, and reshape your data with dplyr.

Run this setup chunk first — it loads the dataset used in all examples below.

filter( )

Keep only rows where a condition is TRUE.

TipComparison operators

== equal · != not equal · > < >= <= greater/less than · & and · | or

select( )

Keep only the columns you need.

rename( )

Rename a column: rename(new_name = old_name).

arrange( )

Sort rows by a column. Wrap in desc() to sort highest-first.

mutate( )

Add or transform columns. See the full mutate() reference page for details.

Combining steps

Chain any number of operations with the pipe — each result flows into the next.