Table: Table

Description Usage Arguments Value Examples

View source: R/Table.R

Description

Convenience function for rendering DT datatables.

Usage

1
2
3
4
5
6
Table(data, colNames = NULL, bRownames = FALSE, style = "default",
  class = "display", dom = "flrtip", ordering = NULL,
  alignment = list(centre = NULL, justify = NULL, left = NULL),
  colWidth = NULL, formatCurr = NULL, formatPerc = NULL,
  formatRoun = NULL, bButtons = FALSE, bResponsive = FALSE,
  pageLen = 15, bScroll = FALSE, filename = "*", esc = TRUE)

Arguments

data

dataframe to be rendered as table

colNames

NULL or chr arr of same length as rows in data. if not NULL chr arr is taken as column names instead of column names of data

bRownames

bool whether to show rownames

style

chr defining style. currently there is only "default" and "bootstrap"

class

chr defining class. "display" is default, "stripe hover" is also nice there are many stlye combinations possible (DT website)

dom

chr for dom arguments. define table elements in order. f filtering, r processing, t table, i information, p pagination, "frtip" is default

ordering

NULL or list of num arr and chr 'asc' or 'desc'. e.g. list(4, 'asc')

alignment

list of 3 elements centre, justify, and left. they can each be NULL(default) or a num arr for which columns to be aligned accordingly. other columnss are right aligned

colWidth

NULL or list with 2 elements: width chr string for width and targets int vector giving column indices. Only works if bScroll TRUE

formatCurr

NULL or list of 2 elements cols (num arr) and curr (chr) for currency formatting of cols columns

formatPerc

NULL or list of 1 element cols (num arr) for percentage formatting of cols columns

formatRoun

NULL or list of 2 elements cols (num arr) and digits (num) for rounding numbers of cols columns to number of digits

bResponsive

bool whether responsive is activated: if table is to narrow, columns are excluded and there is a ugly plus symbol where they can be displayed by clicking

pageLen

num for how many rows are displayed

bScroll

bool whether xScroll is enabled (horizontal scrolling)

filename

chr filename for downloaded data

esc

bool whether to escape HTML, if not JS callback ensures input bindings

buttons

NULL or chr arr defining download buttons used in table ('copy', 'csv', 'excel', 'pdf', 'print')

Value

datatables, htmlwidget object

Examples

1
Table_DT(iris, bButtons = TRUE, alignment = list(left = 2), dom = "t")

mRcSchwering/abacus documentation built on May 21, 2019, 9:18 a.m.