# Example 1: Rename 'cyl' in 'mtcars' to 'cylinder'
df.rename(mtcars, from = "cyl", to = "cylinder")
# Example 2: Rename 'cyl' and 'wt' in 'mtcars' to 'cylinder' and 'weight'
df.rename(mtcars, from = c("cyl", "wt"), to = c("cylinder", "weight"))
Run the code above in your browser using DataLab