I have a function which for some reason returns a a set of characters in the same way dput() does, i.e as "c("A","B","C")". How do get it back to a character vector. i.e [1] "A" "B" "C"
See the following toy example
x = c("A", "B", "C")
dpx = dput(x)
How do I get dpx back to x again?
You can do this:
eval(parse(text = "c(\"A\",\"B\",\"C\")"))
but it is probably a better idea to fix the output of that function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With