vctr_to_str_nl: Convert a vector of values into a string

View source: R/str_to_vctr.R

vctr_to_str_nlR Documentation

Convert a vector of values into a string

Description

Store values neatly in an Excel or other dataframe for summary or record-keeping, but is in a format that can be readily parsed back to an expression if need be. This is important in cases where the names of columns want to be saved for a dataframe in a particular script to reference back or to QA later on. The string can be converted back to a vector by its counterpart function string_to_vector() in this package.

Usage

vctr_to_str_nl(vector, quote = "'")

Examples


# String to Vector
test_vctr <- "c('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J')"
str_to_vctr(test_vctr)

test_vctr <- 'c("A", "B", "C", "D", "E", "F", "G", "H", "I", "J")'
str_to_vctr(test_vctr)

test_vctr <- 'c(\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\")'
str_to_vctr(test_vctr)


# Vector to String
vctr_to_str(LETTERS[1:5])

vctr_to_str(LETTERS[1:5], quote = "\"")

meerapatelmd/suzyBakeOven documentation built on March 30, 2022, 1:44 p.m.