toString | R Documentation |
Transform 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 = "+"
).
toString(x, ...)
## S4 method for signature 'MatrixPrintForm'
toString(
x,
widths = NULL,
tf_wrap = FALSE,
max_width = NULL,
col_gap = mf_colgap(x),
hsep = NULL,
fontspec = font_spec(),
ttype_ok = FALSE
)
x |
( |
... |
additional parameters passed to individual methods. |
widths |
( |
tf_wrap |
( |
max_width |
( |
col_gap |
( |
hsep |
( |
fontspec |
( |
ttype_ok |
( |
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 character string containing the ASCII rendering of the table-like object represented by x
.
wrap_string()
mform <- basic_matrix_form(mtcars)
cat(toString(mform))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.