I am generating a plot which I am able to see in the RMarkdown output but whenever I am trying to save it, I am getting just a blank(white) image. I am just adding following two lines before and after plot
png("Output.png")
#Plot code
dev.off()
It was working. And suddenly it stopped working. Can someone help me on this??
edit
When I do it with pdf
pdf("output.pdf")
#plot code
dev.off()
I am getting error as:
There was error opening this document. This document cannot be opened because it has no pages.
Thanks.