Learn R Programming

rtables (version 0.4.0)

propose_column_widths: Propose Column Widths of an rtable object

Description

The row names are also considered a column for the output

Usage

propose_column_widths(x, mat_form = matrix_form(x, indent_rownames = TRUE))

Arguments

x

rtable object

mat_form

object as created with matrix_form

Value

a vector of column widths based on the content of x (or mat_form if explictly provided) for use in printing and, in the future, in pagination.

Examples

Run this code
# NOT RUN {
library(dplyr)

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

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

tbl <- build_table(l, iris2)

propose_column_widths(tbl)
# }

Run the code above in your browser using DataLab