The R program can be used only to process many different mathematical functions. However, many people choose to use some sort of editing tool while using R. The editing tool provides a place for developing and save codes and functions.
There are many different editing tools available. For Windows, a popular choice is RGui. For Mac, R.app is a common choice. The choice that is quickly becoming the standard for R Users is RStudio. RStudio works on all software platforms. This provides a consistent interface for people despite whatever operating system they are using. Below are some additional benefits of RStudio.
- Brackets are automatically setup when developing code
- Different parts of a code have a corresponding color. This helps in reading the code.
- Code completion. Saves time
Coding in RStudio
The first thing people often do when learning to code is create the message “Hello World.” To do this in RStudio requires the following
- In RStudio make sure the cursor is blinking in the console section (The console is normally in the lower left hand part of the window)
- Type the following and press enter
- print (“Hello World!”)
- After pressing enter you should see the following
-  “Hello World!”
Congrats, you have just developed and implemented your first R Script
Doing Some Math
R can be used for performing math calculations as well. Consider the following example
- Type the following into the console and press enter
- 1 + 3 + 5 + 7
- You should get the following output
-  16
Have some fun playing with the print as well as calculating various math problems as well.