datarename() will rename column names, i.e. To change a single column name, we may use index. If we instead used coffeeRoast, the parentheses wouldnt be needed.
#Rename in r how to
In this tutorial, we will look at how to rename one or more column names in an R dataframe with the help of some examples. Since we have a space between Coffee Roast, we need to use parentheses. A dataframe in R is a two-dimensional data structure used to store the data in rows and columns and perform different operations on it.
The second variable of the data frame is 'Latest Name' and I want to change it to 'Name'. A 'variable' is also commonly referred to as a column name.