0

I have a small shiny application which plot a graph with a log scale when the variable 'logEch' is "x".

This works:

output$plot <- renderPlot({
    logEch<-"x"
    Plotfigure(XHydrau,DataQs, ParHydrau, Rescal,logEch)
})

But when I affect the value "x" from the inputcheckbox 'xlog':

output$plot <- renderPlot({
  if(input$xlog){logEch<-"x"}
  Plotfigure(XHydrau,DataQs, ParHydrau, Rescal,logEch)
})

I obtain the error message: argument is of length zero

What do I need to do to fix this?

FluffyKitten
  • 13,126
  • 10
  • 35
  • 50
Al38
  • 1

1 Answers1

0

As you have not posted full reproducible example i can only assume where the problem lays...

I guess you need to expand your if statement --> there must be if...else... arguments!

so i would add to renderPlot:

if(input$xlog){logEch<-"x"}else{NULL}
Mal_a
  • 3,370
  • 1
  • 23
  • 57