The qc() function is intended to help quote user inputs. It is a convenience function allowing the user to elide excess quotation marks. It quotes its arguments instead of evaluating them, except in the case of a nested call to qc() itself. Please see the examples for typical uses both for named and un-named character vectors.

qc(...)

Arguments

...

items to place into an array

Value

quoted array of character items

See also

Examples

a <- "x" qc(a) # returns the string "a" (not "x")
#> [1] "a"
qc("a") # return the string "a" (not "\"a\"")
#> [1] "a"
qc(sin(x)) # returns the string "sin(x)"
#> [1] "sin(x)"
qc(a, qc(b, c)) # returns c("a", "b", "c")
#> [1] "a" "b" "c"
qc(x=a, qc(y=b, z=c)) # returns c(x="a", y="b", z="c")
#> x y z #> "a" "b" "c"
qc('x'='a', wrapr::qc('y'='b', 'z'='c')) # returns c(x="a", y="b", z="c")
#> x y z #> "a" "b" "c"