3

So I've written this function here which renames the first column in a data frame:

{
  df %>%
    rename({{newname}} := colnames(df[1])) 
}

It ran completely fine. Now when I moved this function to a package I' m building, it suddenly started giving me this error: Error: := can only be used within dynamic dots. I have imported rlang into my package so that's not the problem (before I did that it gave me a different error about not recognizing := at all).

I have no idea what has changed by moving the function to a different folder and google is not much help either.

rjwg
  • 41
  • 3

1 Answers1

1

I solved this myself :) I had to put dplyr:: in front of rename because it was confusing it with plyr::rename which is apparently very different.

rjwg
  • 41
  • 3