I want to pass a line of code in textInput function, like suppose I write list(a = c("b", "c")) in textInput. But textInput would take it as a character string.
Is there any way to do it?
I want to pass a line of code in textInput function, like suppose I write list(a = c("b", "c")) in textInput. But textInput would take it as a character string.
Is there any way to do it?
You can use eval and parse from base R. Please note that it can be dangerous to evaluate user defined code, so think twice.
string <- 'list(a = c("b", "c"))'
eval(parse(text = string))
#$a
#[1] "b" "c"