Open smingerson opened 5 years ago
I put together a first try for behavior 1 above here.
One question is whether skip_absent
should let setnames()
return gracefully instead of erroring if no names are matched by patterns.
@smingerson I think returning gracefully will be better
Allow the use of
setnames(old = patterns(...), new = renaming_function)
Similar to #3703, this makessetnames()
even more convenient to use.One question with this is how
patterns()
would be used insetnames()
. The two options that sprang to my mind:setnames()
operates similar tomelt()
, where multiple patterns can be provided to match different names given in the value.name argument. The first pattern would match the first in a list of functions passed to new, and so on. If only one function was passed, the list would be concatenated or error, depending on preference.