Reputation: 9
I am trying to write a program in R that is basically a graphing calculator. It should take a text input and then plot it.
output$plot1 <- renderPlot({
tempTxt2 <- parse(text=input$userTxtVar)
f1 <- function(x){
return(tempTxt2)
}
curve(expr = f1, from =-3, to =3)
})
I thought parsing the text to an expr might help. It initially gives the same error, but also causes an "unexpected symbol" error. E.g. when I type in "3x":
<text>:1:2: unexpected symbol
1: 3x
^
Upvotes: 1
Views: 70