cat0 {str2str}R Documentation

Concatenate and Print with No Separator

Description

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.

Usage

cat0(
  ...,
  n.before = 1L,
  n.after = 1L,
  file = "",
  fill = FALSE,
  labels = NULL,
  append = FALSE
)

Arguments

...

one or more R objects. See details of cat for types of objects allowed.

n.before

integer vector of length 1 specifying how many line breaks to have before printing the concatenated R objects.

n.after

integer vector of length 1 specifying how many line breaks to have after printing the concatenated R objects.

file

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.

fill

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.

labels

A character vector of labels for the lines printed. Ignored if fill = FALSE.

append

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.

Value

nothing as the function only prints and does not return an R object.

Examples

cat0(names(attitude))
cat0("MODEL COEFFICIENTS:", coef(lm(rating ~ critical + advance, data = attitude)),
   n.before = 0, n.after = 2)

[Package str2str version 1.0.0 Index]