R does not come with a builtin editor.
If you don't have a preferred general use editor (VisualStudio, emacs, vim), you should install Rstudio in addition to R
Instructions for installing R and R studio are described below.
R
Windows
- go here
https://cran.r-project.org/bin/windows/base/
- Download latest version by clicking on link, for example: "Download R 4.1.1 for Windows"
- install exe file once downloaded by opening the exe file
MacOS
Method 1
- go here
https://cran.r-project.org/bin/macosx/
- Download latest pkg version by clicking on link, for example: "R-4.1.1.pkg"
- install pkg once downloaded by opening the downloaded pkg file
Method 2 - via brew
- open terminal
- check to see if the brew package manager is installed by running the terminal command
brew -v
- Intall R via brew by running
brew install R
Linux
Follow instructions here for debian, fedora, redhat, suse, ubuntu distros
https://cran.r-project.org/bin/linux/
For Arch based distros
sudo pacman -S r
Rstudio
Windows/Mac/Linux
Download the appropriate installer from:
https://www.rstudio.com/products/rstudio/download/#download
Mac method 2 - via brew
if you followed Method 2 above for R's base installation
brew install –cask rstudio