We really need more information and probably a reproducible example (reprex)
In the meantime, what happens if you try
xx <- 1:100 pdf("myplot.pdf") plot(xx) dev.off()