问题
I am trying to learn to use kable
and kableExtra
to generate an html document from a shiny app. The code goes something like this:
orthoInstructions <- special_ortho_table()
kable(orthoInstructions, "html", booktabs = T) %>%
kable_styling(full_width = FALSE, position = "center")
The output depends on the special_ortho_table()
in the app and generates a table of varying number of rows but the number of columns are always the same - two.
However, whenever I try to add something more to this to modify the table, altering the column width, or such as described here, or simple changes:
kable(orthoInstructions, "html", booktabs = T) %>%
kable_styling(full_width = FALSE, position = "center") %>% column_spec(1, bold = T)
I get the following error:
Quitting from lines 40-49 (report_drugHTML.Rmd)
Warning: Error in [[: subscript out of bounds
[No stack trace available]
I am fairly new to coding in general, again, am I missing something obvious?
来源:https://stackoverflow.com/questions/59040243/error-in-kable-and-kableextra-in-r-markdown