Hao Zhu | eaef431 | 2018-01-10 17:05:23 -0500 | [diff] [blame] | 1 | #' @import htmlwidgets |
| 2 | #' @export |
Hao Zhu | 7cb0e37 | 2018-01-10 18:29:30 -0500 | [diff] [blame^] | 3 | kableExtraWidget <- function(kable_input, width = NULL, height = NULL) { |
Hao Zhu | eaef431 | 2018-01-10 17:05:23 -0500 | [diff] [blame] | 4 | kable_format <- attr(kable_input, "format") |
| 5 | if (kable_format != "html") { |
| 6 | stop("kable_as_widget only works for HTML tables.") |
| 7 | } |
| 8 | x <- as.character(kable_input) |
| 9 | htmlwidgets::createWidget("kable_as_widget", x, |
| 10 | width = width, height = height) |
| 11 | } |