cat0
concatenates and prints objects without any separator. cat0
is to cat
as paste0
is to paste
. It also allows you to
specify line breaks before (n.before
) and after (n.after
) the
the printing of the concatenated R objects. cat0
function can be useful
in conjunction with sink
for quick and dirty exporting of results.
cat0(
...,
n.before = 1L,
n.after = 1L,
file = "",
fill = FALSE,
labels = NULL,
append = FALSE
)
nothing as the function only prints and does not return an R object.
one or more R objects. See details of cat
for types of objects
allowed.
integer vector of length 1 specifying how many line breaks to have before printing the concatenated R objects.
integer vector of length 1 specifying how many line breaks to have after printing the concatenated R objects.
A connection or a character string naming the file to print to.
If "" (default), cat0
prints to the standard output connection - the
console - unless redirected by sink
.
A logical or (positive) numeric vector of length 1 controlling how
the output is broken into successive lines. If FALSE (default), new line breaks are
only created explicity by "\n"
bring called. If TRUE, the output is broken into
lines with print width equal to the option "width" (options()[["width"]]
).
If a (positive) number, then the output is broken after width of that length.
A character vector of labels for the lines printed. Ignored if
fill
= FALSE.
A logical vector of length 1. Only used if the argument file
is the name of a file (and not a connection). If TRUE, output will be appended
to the existing file. If FALSE, output will overwrite the contents of the file.
cat0(names(attitude))
cat0("MODEL COEFFICIENTS:", coef(lm(rating ~ critical + advance, data = attitude)),
n.before = 0, n.after = 2)
Run the code above in your browser using DataLab