If your file name looks like 2022.03.08 then it would be a problem because Windows will treat the last period as indication of file extension. Then the file you save will be in file format 08 rather than .R.
Manually adding .R in the end of the file name can solve the issue.