Why does `.fn` argument come before `.cols` in `dplyr::rename_with()` instead of after?

dplyr::across() and all the deprecated *_if(), *_at() incantations previously have the columns specified first and then the function or transformation next. What's the thinking with why the argument location of .fn and .cols are reversed in rename_with()?

(My guess was that it's a choice of convenience as in many cases you may just to use the default of .cols = everything()... but was curious.)

1 Like

If you were hoping to speak with the Author I believe it was Hadley himself.

My guess also, is to agree with you that it it prioritises for the convenience of the intended users than to conform to a possibly unprincipled convention (that of order seen in other functions)

I answered this question about rename in this stackoverflow answer:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.