Learn R Programming

clinpubr (version 1.1.1)

vec2code: Generate code from string vector

Description

Generate the code that can be used to generate the string vector. name2code() is a wrapper of vec2code(names(x)) to generate code for names of a vector, list, data frame, or any object with names.

Usage

vec2code(x)

name2code(x)

Value

A string that contains the code to generate the vector.

Arguments

x

A string vector.

Examples

Run this code
vec2code(colnames(mtcars))
name2code(mtcars)

Run the code above in your browser using DataLab