Column Names

We wish to get the names of the columns of a Data Frame.

df %>% names()

Here is how this works:

  • We pass the Data Frame df to the function names().
  • names() returns the names of the columns of the Data Frame as a vector in the order of the Data Frame’s columns.
R
I/O