printc: Generate the literal c() of a character vector

View source: R/misc.R

printcR Documentation

Generate the literal c() of a character vector

Description

It's often needed to create a vector literally even the vector can be obtained in code. For example a sbuset of column names can be get with number index, but it's not safe to use number index in code. Use this function to turn the output of number index into literal format, then you can copy the output to code.

Usage

printc(x)

Arguments

x

a vector holding items x1, x2, ...

Value

string of "c("x1", "x2")"

Examples

printc(names(mtcars)[1:3])


dracodoc/mischelper documentation built on March 25, 2022, 4:38 a.m.