Learn R Programming

basictabler (version 0.3.1)

TableCell: A class that represents a cell in a table

Description

The TableCell class represents a cell in a table. Both header cells and body cells are represented by this class.

Arguments

Value

Object of R6Class with properties and methods that define a single table cell

Format

R6Class object.

Fields

parentTable

Owning table.

rowNumber

The row number of the cell. 1 = the first (i.e. top) data row.

columnNumber

The column number of the cell. 1 = the first (i.e. leftmost) data column.

cellType

One of the following values that specifies the type of cell: root, rowHeader, columnHeader, cell, total. The cellType controls the default styling that is applied to the cell.

visible

TRUE or FALSE to specify whether the cell is rendered.

rawValue

The original unformatted value.

formattedValue

The formatted value (i.e. normally of character data type).

asNBSP

TRUE or FALSE to specify whether cells with no formatted value be output as html nbsp.

baseStyleName

The name of the style applied to this cell (a character value). The style must exist in the TableStyles object associated with the table.

style

A TableStyle object that can apply overrides to the base style for this cell.

Methods

Documentation

For more complete explanations and examples please see the extensive vignettes supplied with this package.

new(...)

Create a new table cell, specifying the field values documented above.

getCopy())

Get a copy of this cell.

asList())

Get a list representation of this cell

asJSON()

Get a JSON representation of this cell

Examples

Run this code
# NOT RUN {
# This class should only be created by using the functions in the table.
# It is not intended to be created by users outside of the table.
library(basictabler)
tbl <- qtbl(data.frame(a=1:2, b=3:4))
cell1 <- tbl$cells$setCell(r=4, c=1, cellType="cell", rawValue=5)
cell2 <- tbl$cells$setCell(r=4, c=2, cellType="cell", rawValue=6)
tbl$renderTable()
# }

Run the code above in your browser using DataLab