 <p>I can't say I understand the root of the issue or why my solution even works for me, but I ran into the same problem and simply added <code>pdf(NULL)</code> at the beginning of my script and everything seems to work just fine. No <code>dev.off()</code> needed (adding it in threw an error for me).</p>