Using R

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

  1. 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)
  2. Type the following and press enter
    1. print (“Hello World!”)
  3. After pressing enter you should see the following
    1. [1] “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

  1. Type the following into the console and press enter
    1. 1 + 3 + 5 + 7
  2. You should get the following output
    1. [1] 16

Have some fun playing with the print as well as calculating various math problems as well.

2 thoughts on “Using R

  1. Pingback: Basics of Vectors Functions in R | educationalresearchtechniques

  2. Pingback: Using R | Education and Research | Scoop.it

Leave a Reply