When using format_tt() on a data frame with column names set to NULL, and without specifying an i or j in format_tt(), this error appears:
Error:
! `value` must be character.
Here's a reprex:
library(tinytable)
# This works
x <- data.frame(x = 1:5)
x |>
tt() |>
format_tt()
# This breaks
x <- data.frame(x = 1:5)
colnames(x) <- NULL
x |>
tt() |>
format_tt()
# But this works
x <- data.frame(x = 1:5)
colnames(x) <- NULL
x |>
tt() |>
format_tt(j = 1)
When using
format_tt()
on a data frame with column names set to NULL, and without specifying ani
orj
informat_tt()
, this error appears:Here's a reprex:
This might be expected behavior, but it used to work—I just stumbled on it after re-rendering a .qmd file I was working with earlier this week, where I had
format_tt(escape = TRUE)
: https://github.com/andrewheiss/mountainous-mackerel/blob/aeb8e21dcfebc94061f4b9352f29794e468c25e8/manuscript/appendix.qmd#L529I'm happy to specify the column index like
format_tt(j = 1:ncol(x), escape = TRUE)
, and it fixes the error—just curious if this is an expected error.