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

gt::tab_spanner_delim (>= 0.10.0) no longer allow "delim" to be more than one character #1469

Closed
mcanouil opened this issue Oct 12, 2023 · 2 comments · Fixed by #1513
Closed

Comments

@mcanouil
Copy link
Contributor

In 0.9.0, it was possible to have something like below to get unique names but still pretty tables using spanner for HTML tables.

  FEATURES          CONTRASTS LIMMA__ESTIMATE LIMMA__P_VALUE COUNTS__MEAN COUNTS__SD
1    Gene1 condition: 1 vs. 0      0.32535759   3.066289e-06     21433.05   8287.407
2    Gene2 condition: 1 vs. 0      0.29437665   2.825313e-06     21664.51   7589.840
3    Gene3 condition: 1 vs. 0     -0.37211278   4.192328e-04     22887.60  10130.252
4    Gene4 condition: 1 vs. 0     -0.47107999   1.999919e-03     19977.46  10677.372
5    Gene5 condition: 1 vs. 0     -0.09331177   3.509038e-02     14634.88   2578.446

image

Reprex:

gt::gt(
  data = structure(list(
    FEATURES = c(
      "Gene1", "Gene2", "Gene3", "Gene4",
      "Gene5"
    ), CONTRASTS = c(
      "condition: 1 vs. 0", "condition: 1 vs. 0",
      "condition: 1 vs. 0", "condition: 1 vs. 0", "condition: 1 vs. 0"
    ), LIMMA__ESTIMATE = c(
      0.325357591624977, 0.294376649868767,
      -0.372112777793342, -0.47107999497371, -0.0933117711552145
    ),
    LIMMA__P_VALUE = c(
      3.06628859857087e-06, 2.8253129711711e-06,
      0.000419232793116877, 0.00199991913409095, 0.0350903776632474
    ), COUNTS__MEAN = c(
      21433.0459458001, 21664.5137266682, 22887.6046442154,
      19977.4641196898, 14634.8752065793
    ), COUNTS__SD = c(
      8287.40744333268,
      7589.84039964603, 10130.2519032155, 10677.3719374534, 2578.44599379548
    )
  ), row.names = c(NA, 5L), class = c("data.frame"))
) |>
  gt::tab_spanner_delim(
    delim = "__",
    columns = dplyr::matches("DESEQ2__|LIMMA__|GLMM__|COUNTS__|ES__|LM__"),
    split = "last"
  )
@olivroy

This comment was marked as off-topic.

@mcanouil
Copy link
Contributor Author

mcanouil commented Nov 2, 2023

I do not think it is related to the issue at end here and is likely to deserve its own issue.

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