Usually helpful in setting extracting levels elsewhere in the code.

toString_to_characterString(string, sep = ",", stripWhitespace = TRUE)

Arguments

string

Long string with delimters, may be output of 'toString'.

sep

delimiter. Default is ",".

stripWhitespace

Whether to trim whitespace on both sides of resulting strings.

Value

A string ready to constructed.

Examples

concat <- toString(colnames(iris)) print(concat)
#> [1] "Sepal.Length, Sepal.Width, Petal.Length, Petal.Width, Species"
toString_to_characterString(concat)
#> [1] "c('Sepal.Length', 'Sepal.Width', 'Petal.Length', 'Petal.Width', 'Species')"
eval(parse(text = toString_to_characterString(concat)))
#> [1] "Sepal.Length" "Sepal.Width" "Petal.Length" "Petal.Width" "Species"