Package 'metalite.table1'

Title: Interactive Table of Descriptive Statistics in HTML
Description: Create an interactive table of descriptive statistics in HTML. This table is typically used for exploratory analysis in a clinical study (referred to as 'Table 1').
Authors: Yilong Zhang [aut, cre]
Maintainer: Yilong Zhang <[email protected]>
License: GPL (>= 3)
Version: 0.4.0
Built: 2026-06-01 08:56:45 UTC
Source: https://github.com/elong0527/metalite.table1

Help Index


Interactive Table of Descriptive Statistics in HTML

Description

Interactive Table of Descriptive Statistics in HTML

Usage

metalite_table1(
  formula,
  data,
  id = NULL,
  var_listing = NULL,
  total = TRUE,
  header = NULL,
  download = "none",
  record_name = NULL,
  ...
)

Arguments

formula

an object of class "formula".

data

a data frame that contain variables described in the formula.

id

a character value to indicate subject/record id variable name in data.

var_listing

a character vector of additional variables included in the drill down listing.

total

a logical value to display or hide "Total" column.

header

a logical vector with length 1 or same length of the variables in formula to show the ⁠Number of xxx⁠ row of each variable. Default is to show the row for the first variable.

download

a character value to enable download button. Allowed values include "none", "listing", "table", and 'all'.

record_name

a character value to control section title (e.g. "Subjects", "Records").

...

additional arguments passed to reactable. More details refer https://glin.github.io/reactable/reference/reactable.html

Value

a shiny.tag.list object that contain a reactable HTML widget for interactive table of describptive statistics.

Examples

if (interactive()) {
  metalite_table1(~ AGE + SEX | TRT01A, data = r2rtf::r2rtf_adsl, id = "SUBJID")
}

Convert to data frame

Description

Convert to data frame

Usage

metalite_table1_to_df(x)

Arguments

x

an output from metalite_table1.

Value

a data frame that contain the table from the html output and a .id variable for variables.


Convert to html

Description

Convert to html

Usage

metalite_table1_to_html(x)

Arguments

x

an output from metalite_table1.

Value

HTML string of reactable HTML widget for interactive table of describptive statistics.


Convert metalite_table1 to an RTF file

Description

Convert metalite_table1 to an RTF file

Usage

metalite_table1_to_rtf(
  x,
  file,
  title = "Baseline Characteristics",
  col_rel_width = NULL
)

Arguments

x

Output of metalite_table1.

file

A character string naming a file to save rtf file.

title

Title in a character string.

col_rel_width

Column relative width in a vector e.g. c(2,1,1) refers to 2:1:1. Default is NULL for equal column width.

Value

a string of the RTF file path


Convert reactable to a data frame

Description

Convert reactable to a data frame

Usage

reactable_to_df(x)

Arguments

x

A reactable HTML widget

Value

A data frame