cati {gsubfn} | R Documentation |
Similar to "cat"
except that the strings can include
"gsubfn"
-like string interpolation.
cati(..., file = "", sep = " ", fill = FALSE, labels = NULL, append = FALSE, env = parent.frame(), pattern = "[$]([[:alpha:]][[:alnum:].]*)|`([^`]+)`", backref = nchar(base::gsub("[^(]", "", pattern)), end = "") cati0(..., sep = "") cat0(..., sep = "") paste0(..., sep = "")
... |
R objects which are coerced to character strings, concatenated, and printed, with the remaining arguments controlling the output. |
file |
A connection, or a character string naming the file to print
to. If '""' (the default), "cat" prints to the standard
output connection, the console unless redirected by "'sink'" . |
sep |
character string to insert between the objects to print. |
fill |
a logical or numeric controlling how the output is broken
into successive lines. If "FALSE" (default), only newlines
created explicitly by "\n" are printed. Otherwise, the
output is broken into lines with print width equal to the
option 'width' if 'fill' is 'TRUE', or the value of 'fill' if
this is numeric. |
labels |
character vector of labels for the lines printed. Ignored if 'fill' is 'FALSE'. |
append |
logical. Only used if the argument "file" is the
name of file
(and not a connection or '"|cmd"' ). If "TRUE" output
will be
appended to "file" ; otherwise, it will overwrite the contents
of "file" . |
env |
Same as in "gsubfn" . Normally not used. |
pattern |
Same as in "gsubfn" . Normally not used. |
backref |
Same as in "gsubfn" . Normally not used. |
end |
String to be appended to the output string. "sep" is
not used to separate "end" . |
"cati"
is similar to "cat"
except that "gsub"
-style
string interpolcation can be used in the arguments.
"cat0"
, "cati0"
and "paste0"
are similar to
the corresponding functions without the "0"
except that the default value for "sep"
is the empty string.
None (invisible 'NULL').
Also see gsubfn
.
cati("pi = $pi, pi rounded = `round(pi,2)`\n") # no comma after 3 as newline specified via end= cati(1, 2, 3, sep = ",", end = "\n")