-->

Rmarkdown and DT: result do not render

2019-07-13 05:58发布

问题:

Do you know how to render this in Rmarkdown?

```{r, results='asis'}

library(DT)

obj <- data.frame(B=as.numeric(1:18), 
                  C=as.factor(c("A","B","C")), 
                  stringsAsFactors=FALSE)

obj <- split(obj, obj$C, drop = TRUE)

lapply(obj, function(x) {
   datatable(x,
             filter = 'top', options = list(
             pageLength = 12, autoWidth = TRUE))
                          }
      )

```

DT tables render in the Viewer of RStudio but cannot have the splitted tables in the .Rmd.. what am I missing?