how to get colnames in r dataframe code example Example: r get name of column in data frame colnames(<dataframe>) #or names(<dataframe>)