if (FALSE) {
data(HairEyeColor)
HEC <- margin.table(HairEyeColor, 1:2)
## gt_tbl from color_table()
color_table(HEC, title = "Hair x Eye Color") |> knit_include()
## DT htmlwidget
DT::datatable(mtcars) |> knit_include(width = 900, height = 500)
## plotly htmlwidget
plotly::plot_ly(mtcars, x = ~wt, y = ~mpg) |> knit_include()
## Any other object passes through unchanged
lm(mpg ~ wt, data = mtcars) |> knit_include()
}
Run the code above in your browser using DataLab