I just a posted the solution there because it worked, but I'm not at all any expert. Andres seems to be far more knowledgable regarding various system configuration related issues.
Since I'm here, the only thing I can say is there is probably no need to add it to PATH via GUI, and also to ~/.Renviron. I'm not sure whether any conflict will occur or not, but why take the risk?
Since your error indicates that something is wrong stats, I'll suggest to uninstall both R and Rtools, and clear the remaining files from Program Files manually, if any. Also, if not a large size, you can consider to delete your personal library as well. By the way, Windows provide the option to see hidden files. See here.
After cleaning, restart you system, and install R 4.0.2 and Rtools40. Then either add to PATH using GUI (what i did, as I'm not a command prompt person), or using that command you used (also suggested in official documentation). After that, see whether you're successful or not directly from R GUI. If prompted, accept separate personal library, to avoid corrupting base R packages.
If all these fail, my limited knowledge is depleted and I'll hope that someone else will help you in this issue. A lot of people seem to have problems with R >=4.0.0, so I must have been terribly lucky.
Anyway, best of luck!
Yes, I meant that. And the environment file has a . before it I think, not just Renviron.
@kmmistr1, it's ~/.Renviron. See your own post:
. before / means current working directory, while ~ is the home directory, and . ina a file name usually makes it hidden. They are not same.