While running my script, I get the following error message during a code that creates a dozen plots in ggplot2 as part of an anlaysis:
Error in grid.Call.graphics(C_setviewport, vp, TRUE) :
non-finite location and/or size for viewport
The error message crashes the code. Interestingly, changing nothing and running the code again will resolve the problem, and it will work just fine. Sometimes, it will crash while creating a different plot.
I haven't been able to find any documentation on why this is happening.
There should be no error, and sometimes it works as expected.