How can I create a data frame from the following string:
my_str <- "a=1, b=2"
In other words, how can I feed y into the data.frame or data.table functions so that it gives me the same thing as
data.frame(a=1, b=2)
Think about how you can easily pass a string of form my_str <- "y~x1+x2+x3"
into a statistical model in R by simply using as.formula(my_str)
and effectively remove the quotes. So I am looking for a similar solution.
Thank you!