Search code examples
rpair-programming

R: 2 Different Computers: Getting "Error: All arguments must be named" in R


I am using the following command to change the column name in a data frame:

df <- rename(df, c("N1" = "N2"))

It works perfectly fine with pair programming partner but I keep getting the following error: "Error: All arguments must be named".

What could this error be caused by?


Solution

  • We can use

    rename(head(mtcars), c("mpg1" = "mpg"))