I updated R last week and found that none of my .r files could be viewed at all. The script pane was just blank even thought the file "opens". The files did contain the code which I could see by viewing them in notepad. I also downloaded and installed the latest version of R-studio.
I expect that others have encountered this problem and I originally posted a question. But, I managed to fix the problem by downdating the version of R from 4.3 to 4.1.