You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For my use case, I need to dynamically remove a column using the delete_columns() function and then add a custom header row with column spans to the resulting table. However, I am encountering issues when attempting this. Here's a minimal reproducible example:
library(flextable)
# Sample data
df <- data.frame(
a = c(1, 2, 3),
b = c(4, 5, 6),
c = c(7, 8, 9)
)
# Create flextable
df_flex <- df |> flextable::flextable()
# Delete a column
df2 <- df_flex |> flextable::delete_columns("b")
# Add a column span header, it produced an error
df2 <- df2 |> flextable::add_header_row(values = c("x"), colwidths = 2)
I would like to know:
Is it possible to add a header row with column spans after deleting a column?
If not, is there a recommended workaround to achieve this behavior?
Thank you for your time and support!
The text was updated successfully, but these errors were encountered:
Hi,
Thank you for developing the flextable package.
For my use case, I need to dynamically remove a column using the delete_columns() function and then add a custom header row with column spans to the resulting table. However, I am encountering issues when attempting this. Here's a minimal reproducible example:
I would like to know:
Thank you for your time and support!
The text was updated successfully, but these errors were encountered: