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

1k Views Asked by At

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?

1

There are 1 best solutions below

0
akrun On BEST ANSWER

We can use

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