-
Notifications
You must be signed in to change notification settings - Fork 8
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
Use repeated colnames #194
Comments
Sorry, I don't understand what you mean. Could explain differently and ideally show me an example of a table like the one you want? |
I'd like to achieve an output like this: tibble(a_sub1 = 1, a_sub2 =2, b_sub1 = 3, b_sub2 = 4) %>%
rename(sub1 = "a_sub1", sub2 = "a_sub2", "sub1 " = "b_sub1", "sub2 " = "b_sub2") %>%
tt() %>%
group_tt(j = list(a = 1:2, b = 3:4)) Howver, it would be nice to achieve it without the workaround of extra spaces in "sub1 " and "sub2 " which are required since a tibble cannot have two columns with identical colnames. |
library(tinytable)
data.frame(sub1 = 1, sub2 = 2, sub1 = 3, sub2 = 4, check.names = FALSE) |>
tt() |>
group_tt(j = list(a = 1:2, b = 3:4))
I’m closing this because this is not a limitation of |
Well, I'd argue, it makes sense that a |
Actually, it looks like tibble(sub1 = 1, sub2 = 2, sub1 = 3, sub2 = 4, .name_repair = "minimal") |>
tt() |>
group_tt(j = list(a = 1:2, b = 3:4)) |
You're right. Interesting. It seems that I guess the issue can be closed. |
I think in combination with group headers it is common to have repeated colnames. What I want to achieve is "a" header a with subheader sub1 & sub2 and a header "b" with sub1 & sub2. Howver, I don't see a way to feed them into tinytable.
dplyr::rename
does not allow duplicates and, as far as I know,tt
doesn't have an argument to set colnames.The text was updated successfully, but these errors were encountered: