qqcat.Rd
Print a string which has been intepolated with variables
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 = "")
text string in which variables are marked with certain rules
environment where to look for those variables
pattern of marks for the variables
pass to cat
pass to cat
pass to cat
pass to cat
pass to cat
prefix string. It is prior than qq.options(cat_prefix)
.
whether call strwrap
to wrap the string
parameters sent to strwrap
, must be a list
Separation character when there are multiple templates.
This function is a shortcut of
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.
a = 1
b = "text"
qqcat("a = @{a}, b = '@{b}'\n")
#> a = 1, b = 'text'
qqcat("a = `a`, b = '`b`'\n", code.pattern = "`CODE`")
#> a = 1, b = 'text'
qq.options("cat_prefix" = function(x) format(Sys.time(), "[%Y-%m-%d %H:%M:%S] "))
qqcat("a = @{a}, b = '@{b}'\n")
#> [2022-08-01 13:57:52] a = 1, b = 'text'
Sys.sleep(2)
qqcat("a = @{a}, b = '@{b}'\n")
#> [2022-08-01 13:57:54] a = 1, b = 'text'
qq.options(RESET = TRUE)