0
votes

I am coding the server part of a shiny project, I try to plot a logistic regression but I got an error saying I need finite ylim values. I don't understand what that means.

output$myLogPlot <- renderPlot({
myFormula <- paste("Success", " ~ ", input$myIV, sep = "")
model<- glm(myFormula,
             data=kickers,
             family=binomial)
plot(myFormula,data=kickers,
     xlab=input$myIV,
     ylab="Pobability")
curve(predict(model,
              data.frame(x=input$myIV),
              type="resp"),
      add=TRUE)
1

1 Answers

0
votes

Your use of curve is wrong. The expression you pass to it must contain x. Try curve(predict(model, data.frame(x=x), type="resp"), add=TRUE). It's generally best to test your R code outside of shiny first.