Skip to contents

Objects of class "dataTable" provide HTML tables with interactive controls powered by the DataTable Javascript library.

Usage

dataTable(x, ...)

# Default S3 method
dataTable(x, ...)

# S3 method for class 'data.frame'
dataTable(x, ...)

# S3 method for class 'dataTable'
display_data(
  x,
  ...,
  metadata = emptyNamedList,
  id = attr(x, "id"),
  update = FALSE
)

Arguments

x

A "dataTable" object

...

Other arguments passed to the initialization method of 'dataTableClass' R6 objects

metadata

A list of metadata strings

id

An ID string

update

A logical value; whether an existing display item will be updated

Methods (by class)

  • dataTable(default): Default method

  • dataTable(data.frame): data.frame method

Methods (by generic)

  • display_data(dataTable): dataTable method for display_data

Functions

  • dataTable(): A dataTable constructor

Public fields

w

A container widget or NULL

page

Number of the current page

m

Width of the object divided by 'size'

r

Remainder of the widht of the object divided by 'size'

size

Number of columns in each group for horizontal paging

iframe

An <iframe> container or NULL

b_left

Button to scroll left

b_right

Button to scroll right

b_first

Button to scroll to the first group of columns

b_last

Button to scroll to the last group of columns

dt

HTML code for the visible table

obj

The tabular object being dispayed

label

A string label that shows the columns being displayed

style

A string with CSS styling

navigator

A container widget that contains the navigator buttons

scrollY

The vertical scroll amount

height

The height of the iframe

Methods


Method new()

Initialize the DataTable

Usage

dataTableClass$new(
  obj,
  size = 50,
  nlines = min(nrow(obj), getOption("dataTable_lines", 20)),
  ...
)

Arguments

obj

The object to be displayed

size

An integer, the number of columns pre-formatted on each page.

nlines

An integer, the approximate number of rows of each page

...

Other arguments, ignored


Method show_columns()

Show which columns are displayed

Usage

dataTableClass$show_columns()


Method page_left()

Go one page to the left

Usage

dataTableClass$page_left()


Method page_right()

Go one page to the right

Usage

dataTableClass$page_right()


Method page_first()

Go to the first page (to the left)

Usage

dataTableClass$page_first()


Method page_last()

Go to the last page (to the right)

Usage

dataTableClass$page_last()


Method draw()

Usage

dataTableClass$draw()


Method set_nlines()

Usage

dataTableClass$set_nlines(nlines)


Method update_nlines()

Usage

dataTableClass$update_nlines(...)


Method clone()

The objects of this class are cloneable with this method.

Usage

dataTableClass$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.