Error in if: the condition has length > 1.

When loading my shiny application, for the output of ggplotly, the shinyapps.io log gives me the following message: Error in if: the condition has length > 1.

I have checked why this message occurs and I saw that it is associated with the use of if(), but that it is solved with ifelse(); in my code, I only use ifelse(), but to generate the output of ggplotly, I do not use ifelse(), so I do not understand where the error can be.

I am grateful if you can guide me to solve this.

1 Like

Hi, welcome!

To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at these resources, to see how to create one for a shiny app

I'm getting exactly this same error, Lekmonm!
Have you ever find out what causes it and how to solve it ?

Feel free to share your own reproducible example of the issue.

Hi, you probably have a logical vector with length > 1 (as a condition), try all() or any() or something similar.

Thank you for caring, nirgrahamuk, but for a newcomer to both R and Shiny, making my first app is challenging enough, I would probably waste too much time trying to build a reprex. If I don't find a solution I'll try it! Thanks