Session Ready
Exercise

Examining Variables

In this module we have learned that every variable has a class. For example, the class can be a character, numeric or logical. The function class() can be used to determine the class of an object.

Here we are going to determine the class of one of the variables in the murders data frame. To extract variables from a data frame we use $, referred to as the accessor.

In the editor we show an example of how to do this. Let`s try it out for ourselves.

Instructions
100 XP

Use the accessor $ to extract the state abbreviations and assign them to the object a. What is the class of this object?