Learn R Programming

rtables (version 0.6.12)

get_formatted_cells: Get formatted cells

Description

Get formatted cells

Usage

get_formatted_cells(obj, shell = FALSE, round_type = c("iec", "sas"))

# S4 method for TableTree get_formatted_cells(obj, shell = FALSE, round_type = c("iec", "sas"))

# S4 method for ElementaryTable get_formatted_cells(obj, shell = FALSE, round_type = c("iec", "sas"))

# S4 method for TableRow get_formatted_cells(obj, shell = FALSE, round_type = c("iec", "sas"))

# S4 method for LabelRow get_formatted_cells(obj, shell = FALSE, round_type = c("iec", "sas"))

get_cell_aligns(obj)

# S4 method for TableTree get_cell_aligns(obj)

# S4 method for ElementaryTable get_cell_aligns(obj)

# S4 method for TableRow get_cell_aligns(obj)

# S4 method for LabelRow get_cell_aligns(obj)

Value

The formatted print-strings for all (body) cells in obj.

Arguments

obj

(ANY)
the object for the accessor to access or modify.

shell

(flag)
whether the formats themselves should be returned instead of the values with formats applied. Defaults to FALSE.

round_type

("iec" or "sas")
the type of rounding to perform. iec, the default, peforms rounding compliant with IEC 60559 (see details), while sas performs nearest-value rounding consistent with rounding within SAS.

Examples

Run this code
library(dplyr)

iris2 <- iris %>%
  group_by(Species) %>%
  mutate(group = as.factor(rep_len(c("a", "b"), length.out = n()))) %>%
  ungroup()

tbl <- basic_table() %>%
  split_cols_by("Species") %>%
  split_cols_by("group") %>%
  analyze(c("Sepal.Length", "Petal.Width"), afun = list_wrap_x(summary), format = "xx.xx") %>%
  build_table(iris2)

get_formatted_cells(tbl)

Run the code above in your browser using DataLab