R Packages

From ECLR
Revision as of 23:33, 9 January 2015 by Rb (talk | contribs)
Jump to: navigation, search

Scripts

When working with R you will typically want to perform a number of steps to perform your analysis. Perhaps you will first have to import data, then do some data transformation, run a regression, plot some regression residuals and save this plot so that you can include it into a written report. While in menu-driven software packages you would perform these steps by step after step using the menus of the software, the workflow in R will be somewhat different.

You will first provide R with a set of written instructions to achieve all the above steps. Once they are collectively written down in a file, here called a script file, you click one button and upon that click R will execute all these tasks in one fine swoop. One great aspect of this way of working is that you save this script file and it is a record of everything you did to obtain your results. This is an excellent way to communicate your work to colleagues. Even better, you can go back, make a small change in your instructions and then easily replicate your entire analysis.

We will see an example of such a script as we introduce packages just below.

Packages

The basic R software has some basic functionality, but the power of R comes from the ability to use code written to perform statistical and econometric techniques that has been written by other people. These additional pieces of software are called packages and the next step will be to learn how ot use these.

Such packages do not come pre-installed into R, but luckily, they are easily installed and used.