Data Frame Column Vector
We reference a data frame column with the double square bracket "[[]]" operator.
For example, to retrieve the ninth column vector of the built-in data set mtcars, we write mtcars[[9]].
We can retrieve the same column vector by its name.
We can also retrieve with the "$" operator in lieu of the double square bracket operator.
Yet another way to retrieve the same column vector is to use the single square bracket "[]" operator. We prepend the column name with a comma character, which signals a wildcard match for the row position.
Tags: