lt_sub: Substitute Cell Values

View source: R/tab.R

lt_subR Documentation

Substitute Cell Values

Description

Replace NA, zero, or small values with display text.

Usage

lt_sub(
  x,
  columns = NULL,
  missing = NULL,
  zero = NULL,
  small = NULL,
  small_text = NULL
)

Arguments

x

An lt() object.

columns

Character vector of column names, a one-sided formula, or NULL for all.

missing

Replacement for NA cells (e.g., "—"). NULL to leave NAs as empty strings (the default rendering).

zero

Replacement for zero values (e.g., "—").

small

Threshold: values whose absolute value is below this are replaced by small_text.

small_text

Text shown for values below small (e.g., "<0.1").

Value

x with the substitution recorded.

Examples

d = data.frame(x = c(1, 0, NA, 0.001))
lt(d) |> lt_sub(missing = "—", zero = "—", small = 0.01, small_text = "<0.01")

lt documentation built on July 10, 2026, 1:09 a.m.