Search This Blog

Friday, February 21, 2014

Installing R Statistical Package on Ubuntu

R is an open-source statistical package like SPSS or SAS. In this post, we will see how to install it on Ubuntu and how to access the demo scripts.

Getting the packages

Installing R is fairly straightforward on Ubuntu. Simply, open a terminal window (using Ctrl-Alt-T, or from the menu), and enter the following command....

$ sudo apt-get install r-base r-base-dev



The system prompts to install the necessary R libraries as shown below.


Running R for the first time

Once R is installed, simply type R at the command prompt, as follows:



That brings up the R prompt that can be used for statistical analysis. We can do a small test right here.

Type demo(lm.glm) to see some examples of Generalized Linear Regression.



Entering return brings multiple examples. The following screen shows the second example.



The script keeps prompting additional examples, and one needs to press Enter to see the next example.



One can enter, ^C to exit the demo and q() to exit the R prompt.



That's it, we are done!

Happy modeling, everyone!


No comments: