DT is a package that displays data frames in a user-friendly way. It works especially well inside R Markdown documents, which can incorporate “HTML widgets,” or little chunks of website that get built from the R script, incorporating datasets and analyses in really interesting ways.

Default DT output

DT::datatable(no2_head)

Changing DT style with classes

DT::datatable(no2_head, class = 'cell-border stripe')

Changing additional defaults

DT::datatable(no2_head, options = list(
  pageLength = 5,
  lengthMenu = c(5, 10, 15, 20)
))

Adding column filters

DT::datatable(no2_head, 
              filter = 'top', 
              options = list(
  pageLength = 5,
  lengthMenu = c(5, 10, 15, 20)
))