Explore Courses Blog Tutorials Interview Questions
0 votes
in R Programming by (50.2k points)

I just want to pass a line of code in textInput function, like say for instance I write:

 list(a = c("b", "c")) 

in the textInput. But textInput would take it as a character string.

Is there any way to do it?

1 Answer

0 votes
by (108k points)

In R programming you can use the eval() and parse() functions from base R. 

string <- 'list(a = c("b", "c"))'

eval&#40;parse(text = string&#41;)


#[1] "b" "c"

Browse Categories