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.
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.
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.