| tags: [ R R packages Rmarkdown ] categories: [Coding ]

Interactive data tables in RMarkdown with DT

DT: An R interface to the DataTables library

We can use the R package DT to render interactive (and pretty) table in HTML. From the RStudio documentation:

The R package DT provides an R interface to the JavaScript library DataTables. R data objects (matrices or data frames) can be displayed as tables on HTML pages, and DataTables provides filtering, pagination, sorting, and many other features in the tables.

A simple example:

library(DT)
datatable(iris)