Save up to $499! Grab all Python courses for $49 or all online courses we’ve ever launched for only $169. Only Feb 11-16. Happy Valentine's!
Getting started with tibbles
Creating tibbles
Subsetting
13. Extract columns by [
Summary

Instruction

Ok, but what about the [ operator? What happens when we use it to extract a column? Let's try it, assigning the results to a new variable. In our employees example, this would look like

departments <- employees[,"department"]

supposing we were assigning the results to the departments variable.

Exercise

Extract the product column from orders using the [ operator. Assign the results to the products variable.

Stuck? Here's a hint!

Type:

products <- orders[,"product"]