Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

character vector for column labels? #830

Closed
apsteinmetz opened this issue Sep 1, 2021 · 1 comment
Closed

character vector for column labels? #830

apsteinmetz opened this issue Sep 1, 2021 · 1 comment

Comments

@apsteinmetz
Copy link

With labeling columns I understand that both uses of cols_label() below are valid but isn't the second, also requiring a named list, superfluous?

gt() %>%
    cols_label(my_label = "My Label", another_one = "Another Label")

gt() %>%
    cols_label(.list= list(my_label = "My Label", another_one = "Another Label"))

It seems that allowing a simple character vector would be an enhancement by reducing typing. Naturally, this would require that all columns get new labels and the character vector be equal to ncol() of the data frame.

gt() %>%
    cols_label(col_names = c("My Label", "Another Label"))

Thanks.

@rich-iannone
Copy link
Member

This is a good idea. We need to think of a nice way to implement this but I'm sure it can be done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants