Skip to contents

This function takes one or more expressions and concatenates them into a single string without quotes. It is particularly useful for creating strings from variable names or expressions without including the usual quotes.

Usage

cc(...)

Arguments

...

strings to be concatenated. Note that numeric values should be converted to strings before being passed.

Value

A character string representing the concatenated values of the input expressions.

Author

Ahmed El-Gabbas

Examples

cc(A, B, C)
#> [1] "A" "B" "C"

# -------------------------------------------

cc(A, B, "A and B")
#> [1] "A"       "B"       "A and B"

# -------------------------------------------

# this does not work
try(cc(A, B, "A and B", 10))
#> Error in sym(expr) : Can't convert a double vector to a symbol.

# this works
cc(A, B, "A and B", "10")
#> [1] "A"       "B"       "A and B" "10"