R plot fail to run


I don't know why suddenly I can't run any codes that will produce graphs in either R or RStudio.

If the codes will not produce graphs, then they work normally. But as long as the codes produce graphs, R just keeps running and it doesn't give me any graphs.

I've tried every methods that I could found online. I've tried dev.off(), graphics.off(), reloaded the whole R, RStudio, XQuartz softwares. But none of these methods fix my problems.

My computer is Mac M1 (ver 12.3), R version 4.2.3 (2023-03-15), R studio version 2023.03.0+386

Btw, I was typing STATA codes into my R markdown files this morning, I'm not sure whether the whole problems arise because of this.

Any helps appreciated!!

It could be any number of resons but

is a hint. It may not be the Stata code per se but that message

[Workspace loaded from ~/.RData  means your are resetting your environment to whatever you were doing  before you shut down **R** and RStudio.

Generally it does not seem to be a good idea to do this.  

I suggest doing "Tools -> Global Options" 

and unchecking the Restore RData option and restarting both **R** and RStudio.
1 Like


Thanks for responding.

I still can't figure out the exact reason for my problem.
So I re-installed the whole Mac OS, and that finally works for me haha.

I suspect that there's something wrong when I was typing stata codes with the package Statamarkdown,
All I did basically was trying to draw a histogram using stata codes.

That's the only unusual thing I did yesterday and I would never ever try that again.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.