Examples for 'DT::datatable'


Create an HTML table widget using the DataTables library

Aliases: datatable

Keywords:

### ** Examples

library(DT)

# see the package vignette for examples and the link to website
vignette('DT', package = 'DT')
starting httpd help server ... done
# some boring edge cases for testing purposes
m = matrix(nrow = 0, ncol = 5, dimnames = list(NULL, letters[1:5]))
datatable(m)  # zero rows
Error in loadNamespace(name): there is no package called 'webshot'
datatable(as.data.frame(m))
Error in loadNamespace(name): there is no package called 'webshot'
m = matrix(1, dimnames = list(NULL, 'a'))
datatable(m)  # one row and one column
Error in loadNamespace(name): there is no package called 'webshot'
datatable(as.data.frame(m))
Error in loadNamespace(name): there is no package called 'webshot'
m = data.frame(a = 1, b = 2, c = 3)
datatable(m)
Error in loadNamespace(name): there is no package called 'webshot'
datatable(as.matrix(m))
Error in loadNamespace(name): there is no package called 'webshot'
# dates
datatable(data.frame(
  date = seq(as.Date("2015-01-01"), by = "day", length.out = 5), x = 1:5
))
Error in loadNamespace(name): there is no package called 'webshot'
datatable(data.frame(x = Sys.Date()))
Error in loadNamespace(name): there is no package called 'webshot'
datatable(data.frame(x = Sys.time()))
Error in loadNamespace(name): there is no package called 'webshot'

[Package DT version 0.23 Index]