Hi I try to have some user-input string, what if the string has quotation marks (don't know single/double)?
Specifically, I want to store some R code in a string, e.g.,
x = 'a'
y = "b"
how do I store this code in a string (later I will use eval(parse(text=x))
to execute it)
Update:
if ask the user to put in the string at readline()
prompt, R will automatically fix the quotation marks:
> readline()
123, "4", '56'
[1] "123, \"4\", '56'"
I'm looking at how to allow user paste multiple lines