Personal tools

General Information on R

R is a free software environment for statistical computing and graphics.

 

R home page: http://www.r-project.org/

 

Download R from one of the mirrors:  http://cran.r-project.org/mirrors.html

 

 In addition to the base R software, you may want or need to use the contributed packages which are also available from the mirror sites.  According to the mirror sites, “Currently, the CRAN package repository features 1665 objects including 1658 packages and 7 bundles containing 26 packages, for a total of 1684 available packages.”

 

The link for each package will point to a page with some additional information on the package, as well as the source files for the package. 

 

Contributed packages have been “bundled” into CRAN Task Views for areas of interest.  One of the views is SocialSciences (http://lib.stat.cmu.edu/R/CRAN/web/views/SocialSciences.html).  To install any of the views, the ctv contributed package must be installed.  Instructions on installing the ctv package and installing or updating the views are at the bottom of the task views page.

 

In addition to the contributed packages, there is a large amount of documentation available.

 

 

R by default will store data in files in the folder or directory from where it is called.  If an individual is working on multiple projects, it would be best to have a folder for each project. 

 

On Windows, the following can be done:

●         Create a folder that will contain the data and related files

●         From the program menu, right click on the R entry and send to the desktop

●         Right click on the desktop icon and  select properties

●         Enter the location of the folder in the “Start in:” field

●         Double click on the icon to start the R session

 

 

 Once R is started, most of the work will be done from the console.  Commands should be entered after the command prompt “>”.   Help can be found by using the “Help” in the toolbar.  Help can also be invoked from the command prompt by using the help function e.g. help(table), or by entering the function or operator preceded by a question mark, e.g. ?sum or ?”+”.  The help.search function will search for the word specified,  for example, help.search(“anova”) will return possibilities for functions relating to the string.

 

R works on objects.  R objects can be data, functions, results of operations, etc.  Object names can consist of letters, numbers, and periods.  Object names are case sensitive.  Object names should start with letters or periods.  However, an object cannot start with a period followed by a number. 

Document Actions

Copyright ©2009, The Pennsylvania State University | Privacy and Legal Statements
Contact the Help Site Administrator | Last modified Feb 26, 2009 | Weblion Partner