How to Sort Text Cases in R
The Benefits of Using R
How to Remove Rows with Missing Data in R

How to Navigate RGui

As part of the process of downloading and installing R, you get the standard graphical user interface (GUI), called RGui. RGui gives you some tools to manage your R environment — most important, a console window. The console is where you type instructions, or scripts, and generally get R to do useful things for you.

Explore the R console

The standard installation process creates useful menu shortcuts (although this may not be true if you use Linux, because there is no standard RGui editor for Linux). In the menu system, look for a folder called R, and then find an icon called R followed by a version number.

image0.jpg

When you open RGui for the first time, you see the R Console screen, which lists some basic information such as your version of R and the licensing conditions.

image1.jpg

Below all this information is the R prompt, denoted by a > symbol. The prompt indicates where you type your commands to R; you see a blinking cursor to the right of the prompt.

Issue a simple command in the R console

Use the console to issue a very simple command to R. Type the following to calculate the sum of some numbers:

> 24+7+11

R responds immediately to your command, calculates the total, and displays it in the console:

> 24+7+11
[1] 42

The answer is 42. R gives you one other piece of information: The [1] preceding 42 indicates that the value 42 is the first element in your answer. It is, in fact, the only element in your answer!

One of the clever things about R is that it can deal with calculating many values at the same time, which is called vector operations. You need to know is that R can handle more than one value at a time.

Close the R console

To quit your R session, type the following code in the console, after the command prompt (>):

> q()

R asks you a question to make sure that you meant to quit,. Click No, because you have nothing to save. This action closes your R session (as well as RGui, if you’ve been using RGui as your code editor).

  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
How to Create a Bar Chart Using ggplot2 in R
How to Create a Data Frame from Scratch in R
How to Remove Duplicate Data in R
How to Format and Perform Operations on Dates and Times in R
How to Do More with Loops in R
Advertisement

Inside Dummies.com