Research and Statistical Support

UIT | ACUS | Help Desk | Training | About Us | Publications | RSS Home

Back to the Do it yourself Introduction to R

1.) Downloading R. When you first go to CRAN to download R, you will be prompted to select which operating system you will be using. Once you click on ‘Windows’ you will be confronted with two choices; ‘base’ and ‘contrib’. You only need the ‘base’. Later we will install packages which allow you enjoy all the functioning of R. Once you click on ‘base’ you will be confronted with a page showing (in bold) a link to ‘Download R x.xx.x for Windows’ where the series of x indicate the current version (e.g. 2.14.0). Once you click on the download link; you will be prompted to save the file somewhere on your computer. Saving it to the desktop is fine; there will be no need to keep it after you have installed R.

2.) Installing R. You will need to have administrator privileges in order to install R. Double click on the executable file to install R. The default options/settings as specified during installation will be fine. The program can very easily be customized after installation.

 There are three windows you’ll likely use every time you use R. The GUI or console window is the core of the program and can act as both input and output display. The graphics window, which as the name implies, displays graphical output (e.g. histograms, scatter plots, topographical displays of terrain, thermal images, etc.). The script window displays script (also called syntax, or program code, or input code), which is not necessary, but often preferred as a way of building script and proof reading it prior to submitting it for processing. Note, there are several free script editors available (e.g. Tinn-R); but the basic one included in the base install of R works fine (I use Tinn-R version 1.19.4.7). Those interested in a more comphrensive interface for R might be interested in RStudio

3.) The first time you open R. You will be confronted with a window in a window. It is recommended (but not necessary) you change the display by changing the GUI preferences; GUI stands for Graphical User Interface. At the top of the window, click on ‘Edit’ then click on ‘GUI preferences…’. Many of these preferences are self explanatory; but here are a few I use: ‘SDI’ and ‘single window’ which changes the console/GUI to a single window display once applied and changes are saved. I prefer font size of 12 which is a little larger and easier for my old eyes to read, but not so large as to dramatically cut down the amount of character lines displayed. I generally change the Pager rows and columns so that the console window is quite large—the specific numbers will be dependent on your screen size/resolution; so it may take some trial and error fiddling to get what you want. I also set the Initial left and top to zero so that the console window opens at the top/left of my screen when I open R. Again, these are merely preferences and each of you should set the program up in a way which is most comfortable for you. Once you have the preferences set how you want them, you will need to SAVE them; regardless of whether or not you apply them. To save your GUI preferences, click the ‘Save…’ button on the bottom of the GUI preferences. You will be prompted to select a directory in which to save the Rconsole. You must save this file in the ‘etc’ directory if you want the changes to be present each time you open the R program; this directory is located inside the R directory where you installed the program, generally at:  

C:\Program Files\R\R-x.xx.x\etc

where x.xx.x refers to the version number of the R installation you have (e.g. R-2.15.0). Once you have saved the GUI preferences, close the program (no need to save workspace image—more on this later) and open it again to make sure the changes have been saved and are being applied.

Congratulations; you now have a working, albeit limited, version of R—and it was completely FREE!

Back to the Do it yourself Introduction to R

UNT home page | Search UNT | UNT news | UNT events

Contact Information

Jon Starkweather, PhD

Jonathan.Starkweather@unt.edu

940-565-4066

Richard Herrington, PhD

Richard.Herrington@unt.edu

940-565-2140

Last updated: 01/21/14 by Jon Starkweather.

UIT | ACUS | Help Desk | Training | About Us | Publications | RSS Home