DataTableWithRItemFormat: 'DataTableWithRItemFormat'

View source: R/tables.R

DataTableWithRItemFormatR Documentation

DataTableWithRItemFormat

Description

Create an HTML widget DataTable which looks like Q's blue table style. Facilitates nicer printing of wrapping text and coefficient matrices.

Usage

DataTableWithRItemFormat(
  dd,
  caption = NULL,
  header.alignments = NULL,
  allow.length.change = TRUE,
  length.menu = c(10, 15, 20),
  page.length = min(15, nrow(dd)),
  allow.paging = TRUE,
  show.info = TRUE,
  escape.html = TRUE
)

Arguments

dd

The data frame that you want to show as a widget.

caption

Text to be placed beneath the table.

header.alignments

A character vector with one element for each column in dd which specifies whether the cells of each column should be left or right aligned. Acceptable values are "right" and "left". If you don't specify the alignments then columns that look like text will be left-aligned, and columns that look like numbers will be right-aligned.

allow.length.change

Boolean value that determines whether or not the user is given a menu allowing them to choose the height of the table.

length.menu

A vector of integers specifying the options to show in the menu of table heights.

page.length

An integer specifying the initial height of the table.

allow.paging

A boolean value to specify whether pagination is turned on.

show.info

A boolean value to specify whether or not extra info is shown below the table, including pagination info like "Showing 5 of 10 items".

escape.html

Either a boolean value or a vector of integers which determines how to escape html characters in the table. If TRUE, then all columns are escaped, and so no html code will be executed. If FALSE, then no columns will be escaped. A vector of positive integers allows you to specify the columns to be escaped. A vector of negative integers allows you to specify which columns not to escape.

Examples

my.df <- data.frame(First = c(1,2,3), Second = c("a", "b", "c"))
my.dt <- DataTableWithRItemFormat(my.df, caption = "A nice table")
my.dt

Displayr/flipFormat documentation built on Aug. 28, 2024, 6:48 p.m.