Transform a complex object into a string representation ready to be printed or written to a plain-text file
toString(x, ...)# S4 method for MatrixPrintForm
toString(
x,
widths = NULL,
tf_wrap = FALSE,
max_width = NULL,
col_gap = mf_colgap(x),
hsep = default_hsep()
)
A character string containing the ASCII rendering
of the table-like object represented by x
ANY. Object to be prepared for rendering.
Passed to individual methods.
numeric (or NULL). (proposed) widths for the columns
of x
. The expected length of this numeric vector can be
retrieved with ncol() + 1
as the column of row names must
also be considered.
logical(1). Should the texts for title, subtitle, and footnotes be wrapped?
integer(1), character(1) or NULL. Width that title
and footer (including footnotes) materials should be
word-wrapped to. If NULL, it is set to the current print width
of the session (getOption("width")
). If set to "auto"
,
the width of the table (plus any table inset) is used. Ignored
completely if tf_wrap
is FALSE
.
numeric(1). Space (in characters) between columns
character(1). Characters to repeat to create header/body separator line.
Manual insertion of newlines is not supported when tf_wrap
is on
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.
mform <- basic_matrix_form(mtcars)
cat(toString(mform))
Run the code above in your browser using DataLab