| toString,VTableTree-method | R Documentation |
rtable object to a stringTransform a complex object into a string representation ready to be printed or written to a plain-text file.
All objects that are printed to console pass via toString. This function allows
fundamental formatting specifications to be applied to final output, like column widths
and relative wrapping (width), title and footer wrapping (tf_wrap = TRUE and
max_width), and horizontal separator character (e.g. hsep = "+").
## S4 method for signature 'VTableTree'
toString(
x,
widths = NULL,
col_gap = 3,
hsep = horizontal_sep(x),
indent_size = 2,
tf_wrap = FALSE,
max_width = NULL,
fontspec = font_spec(),
ttype_ok = FALSE,
round_type = c("iec", "sas")
)
x |
( |
widths |
( |
col_gap |
( |
hsep |
( |
indent_size |
( |
tf_wrap |
( |
max_width |
( |
fontspec |
( |
ttype_ok |
( |
round_type |
( |
Manual insertion of newlines is not supported when tf_wrap = TRUE and will result in a warning and
undefined wrapping behavior. Passing vectors of already split strings remains supported, however in this
case each string is word-wrapped separately with the behavior described above.
A string representation of x as it appears when printed.
wrap_string()
library(dplyr)
iris2 <- iris %>%
group_by(Species) %>%
mutate(group = as.factor(rep_len(c("a", "b"), length.out = n()))) %>%
ungroup()
lyt <- 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(lyt, iris2)
cat(toString(tbl, col_gap = 3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.