Create vector of characters from unquoted strings (variable names)
qc
It is often needed to address variables in the data.frame in the such
manner: dfs[ , c("var1", "var2", "var3")]
. qc
("quoted c") is a
shortcut for the such cases to reduce keystrokes. With qc
you can write:
dfs[ , qc(var1, var2, var3)]
.
qe
returns list of expression. It is useful to create substitution list for ..$arg
.
text_expand
is simple string interpolation function. It searches in its
arguments expressions in curly brackets {expr}
, evaluate them and substitute with
the result of evaluation. See examples.
qc(...) qe(...) text_expand(..., delim = c("\\{", "\\}"))
... |
characters in |
delim |
character vector of length 2 - pair of opening and closing
delimiters for the templating tags. By default it is curly brackets. Note
that |
Vector of characters
## qc qc(a, b, c) identical(qc(a, b, c), c("a", "b", "c")) mtcars[, qc(am, mpg, gear)] ## text_expand i = 1:5 text_expand("q{i}") i = 1:3 j = 1:3 text_expand("q1_{i}_{j}") data(iris) text_expand("'iris' has {nrow(iris)} rows.") ## qe qe(mrset(a1 %to% a6), mrset(b1 %to% b6), mrset(c1 %to% c6))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.