Error in if: the condition has length > 1.

When loading my shiny application, for the output of ggplotly, the 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.

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