What is the opposite of dput() in R?

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?

Answers


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.


Need Your Help

Query/400 Unmatched scenario

ibm-midrange db2400

the task i have is to produce a report of 'slow moving inventory' for the past 2 months. (04-05). All the instructions i was given by the long time lead dev. this erp is written in the early 90's ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.