Learn R Programming

teal.reporter (version 0.4.0)

TableBlock: TableBlock

Description

Specialized FileBlock for managing table content in reports. It's designed to handle various table formats, converting them into a consistent, document-ready format (e.g., flextable) for inclusion in reports.

Arguments

Super classes

teal.reporter::ContentBlock -> teal.reporter::FileBlock -> TableBlock

Methods

Inherited methods


Method new()

Initialize a TableBlock object.

Usage

TableBlock$new(table)

Arguments

table

(data.frame or rtables or TableTree or ElementaryTable or listing_df) a table assigned to this TableBlock

Returns

Object of class TableBlock, invisibly.


Method set_content()

Sets content of this TableBlock.

Usage

TableBlock$set_content(content)

Arguments

content

(data.frame or rtables or TableTree or ElementaryTable or listing_df) a table assigned to this TableBlock

Details

Raises error if argument is not a table-like object.

Returns

self, invisibly.

Examples

TableBlock <- getFromNamespace("TableBlock", "teal.reporter")
block <- TableBlock$new()
block$set_content(iris)


Method clone()

The objects of this class are cloneable with this method.

Usage

TableBlock$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

Run this code

## ------------------------------------------------
## Method `TableBlock$set_content`
## ------------------------------------------------

TableBlock <- getFromNamespace("TableBlock", "teal.reporter")
block <- TableBlock$new()
block$set_content(iris)

Run the code above in your browser using DataLab