Note the black rectangular patch. I had to quit and start all over again. It doesn't happen for a short sleep (an hour or two) but quite often over an overnight sleep (more than 8 hours).
This happens after I installed the newest version of RStudio from 2022.0.2.3.
This is probably an issue with RStudio's rendering engine. If you're willing to try a preview release, we have one with a new Electron based rendering engine you can try here:
(you want a build from the Desktop Electron Version section of that page)
I installed RStudio 2022.07.1 Build 554 two days ago. This morning when I woke up my computer, again it froze and I had to quit the session and start the session all over again.
I'm using a Widows 11 machine with R version 4.2.0.