Late reply, but I just had a similar situation and maybe this will help someone else.
I was also making a line chart with very similar arguments to your plot_ly()
, and receiving the same error.
I couldn't make sense of it, the data itself was fine, I hadn't overwritten any functions as some other answers suggested...
What turned out to be the key was my use of the group_by()
and summarise()
functions beforehand. I grouped my data according to months, and wanted the plot to display time on the x axis. However, plotly has special considerations for grouped data - from what I understand, it tries to make a separate trace for each group level.
The exact combination of grouping and x-axis variable made this task apparently crash R.
Solution
The solution was simple: just stick a .groups = "drop"
at the end of summarise()
(or use ungroup()
at some point before handing the data to the plot.) This will eliminate any leftover groupings, and make Plotly behave as expected.
The biggest issue is that the error message was in no way indicative at what point things were going wrong.