A Friendly Datatable

datatable_EZ() is a wrapper around DT::datatable() with more convenient defaults. Also, most common elements of the options() argument are moved to direct arguments list for this function. This removes to necessity to pass on long options list (which is not well documented in the DT package documentation). It also makes these options available for auto-complete drop-downs in RStudio.

library(datatableEZ)

Original datatable

datatable(iris)

Easy Datatable

datatable_EZ(
    iris,
    dom="t",
    columnDefs = list(list(width = '50px', targets = c(1, 3))),
    order = list(list(0, 'desc'), list(1, 'asc'))
)

Pagination

datatable_EZ(iris, pageLength = 3, lengthMenu = c(3,5,10))

Static Version

Disables sorting and searching by the user.

datatable_EZ(iris, ordering = FALSE, dom = "t")

Conditional Databars

A simple way to add conditional formatting databars to one or more columns.

iris %>% 
    datatable_EZ() %>% 
    format_databars(~Sepal.Length + Sepal.Width + Petal.Length)


vadimus202/datatableEZ documentation built on May 3, 2019, 2:41 p.m.