Reputation: 2561
I am using kable()
from knitr package to show a table on a html document. Is it possible to make it sortable? Some sample code,
---
title: "Test"
output: html_document
---
```{r, echo=FALSE, comment=""}
kable(data.frame("a"=1:10,"b"=11:20),digits=2)
```
Upvotes: 31
Views: 24938
Reputation: 30114
The package DT (https://github.com/rstudio/DT) is an R interface to the JavaScript library DataTables. You can use it in R Markdown, e.g.
```{r}
DT::datatable(iris)
```
Upvotes: 65