qqcat {GetoptLong} | R Documentation |
Print a string which has been intepolated with variables
Description
Print a string which has been intepolated with variables
Usage
qqcat(..., envir = parent.frame(), code.pattern = NULL, file = "",
sep = " ", fill = FALSE, labels = NULL, append = FALSE, cat_prefix = NULL,
strwrap = qq.options("cat_strwrap"), strwrap_param = list(), sep2 = "")
Arguments
... |
text string in which variables are marked with certain rules |
envir |
environment where to look for those variables |
code.pattern |
pattern of marks for the variables |
file |
pass to |
sep |
pass to |
fill |
pass to |
labels |
pass to |
append |
pass to |
cat_prefix |
prefix string. It is prior than |
strwrap |
whether call |
strwrap_param |
parameters sent to |
sep2 |
Separation character when there are multiple templates. |
Details
This function is a shortcut of
cat(qq(text, envir, code.pattern), ...)
Additionally, you can add global prefix:
qq.options("cat_prefix" = "[INFO] ") qq.options("cat_prefix" = function(x) format(Sys.time(), "[%Y-%m-%d %H:%M:%S] ")) qq.options("cat_prefix" = NULL)
You can also add local prefix by specifying cat_prefix
in qqcat
.
qqcat(text, cat_prefix = "[INFO] ")
Please refer to qq
to find more details.
Author(s)
Zuguang Gu <z.gu@dkfz.de>
Examples
a = 1
b = "text"
qqcat("a = @{a}, b = '@{b}'\n")
qqcat("a = `a`, b = '`b`'\n", code.pattern = "`CODE`")
qq.options("cat_prefix" = function(x) format(Sys.time(), "[%Y-%m-%d %H:%M:%S] "))
qqcat("a = @{a}, b = '@{b}'\n")
Sys.sleep(2)
qqcat("a = @{a}, b = '@{b}'\n")
qq.options(RESET = TRUE)
[Package GetoptLong version 1.0.5 Index]