I have an older version of R and Rstudio running in my Fedora 21. What is the command to upgrade to the latest version of R and Rstudio?
Fedora 21 is no longer supported, reaching end-of-life on December 1st, 2015. However, the current version of Fedora contains — as of right now — R version 3.3.1, which is the latest. (It looks to be the case that R is kept pretty current if you're on the newest Fedora.)
Upgrading straight from Fedora 21 to Fedora 24 might work, but we officially only support skipping one release (so F22 to F24 definitely should). That's not much comfort now, but we've put a lot of work recently into making updates smooth and seamless, so you can basically take a little bit of time once or twice a year and hop to the new version — which should also keep you up to date with R. (For now, going from F21 to F22, and then F22 to F24 should do it.)
If this isn't a possibility for you, another option is to download the source RPM from Fedora 24 and rebuild it. This will Probably Work™.