Not necessarily: when installing newer versions of R, it's common to leave the old one; for RStudio I think the installer takes care of uninstalling the old version.
In your case, if you're worried about the old version version being compromised, maybe explicitly uninstalling beforehand is preferable.
You should always have a saved version of your files, if only because hard drives fail regularly, laptops gets stolen, files get corrupted, etc. The currently accepted best practice is to use git, but that has a steep learning curve. At the very least you should have a *Drive or *Cloud copy somewhere.
That being said, no, de/re-installing R and RStudio should only affect their own files, typically in C:\Program Files
, and optionally some cache and configuration (e.g. registry entries, stuff in %AppData%
, ...), it should not affect your saved files in your personal folders.