gt
gt copied to clipboard
Adds `.col_names` param to `cols_label()`
Resolves #830
A few checks are completed:
-
.col_names
defaults toNULL
- If not
NULL
,...
and.list
should not havelength()
-
.col_names
must be the same length as thecolnames
from the original data -
.col_names
should not havenames
-- gives a warning as the names would be overwritten and vector is expected to be in order
Local tests didn't show any conflicts with this
Thanks for the PR, but after a pretty long think about this one, I decided that this might be potentially difficult for the user during iteration; columns could be moved around (by gt or through the API), and columns could get used for the stub or as groups. At that point, it's hard to keep track of the original column order for renaming. But the next best thing to this is probably the .list
argument.