Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Getting started with tibbles
Creating tibbles
Subsetting
12. Extract columns by position and [[
Summary

Instruction

We can also use [[ to extract columns by their position in the tibble. In the employees tibble, the department column is the 4th column. To extract it, we enter:

employees[[4]]

Exercise

Extract the product column from orders using [[ and its position number.

Stuck? Here's a hint!

Products are in the 5th column of the orders tibble.

Type:

orders[[5]]