Rainbow Deals - hours only!Up to 80% off on all courses and bundles.-Close
Filtering by row
Extracting data by column
13. Exclude columns by position
Practice using filter() and select()
The pipe operator
Sorting rows


As with filter(), we can choose not to include some columns in our results. In this case, we use the - operator and the positions of the columns we don't want. If we didn't want column 5 from countries, we'd write:

select(countries, -5)


Select all columns except the third and fourth columns from countries. Use a comma (,) to separate the columns. Place a - in front of each column number.

Stuck? Here's a hint!


select(countries, -3, -4)