Example: barber

Data analysis using R and the R-commander (Rcmdr)

data analysis using R and the R-commander ( rcmdr ). Graeme D. Hutcheson Manchester University Chapter 1. R and the rcmdr R provides a powerful and comprehensive system for analysing data and when used in conjunction with the R-commander (a graphical user interface, commonly known as rcmdr ) it also provides one that is easy and intuitive to use. Basically, R provides the engine that carries out the analyses and rcmdr provides a convenient way for users to input commands. The rcmdr program enables analysts to access a selection of commonly-used R commands using a simple interface that should be familiar to most computer users. It also serves the important role of helping users to implement R commands and develop their knowledge and expertise in using the command line an important skill for those wishing to exploit the full power of the program.

Chapter 1 R and the Rcmdr R provides a powerful and comprehensive system for analysing data and whenusedinconjunctionwiththeR-commander(agraphicaluserinterface,

Tags:

  Analysis, Using, Data, Commander, Data analysis using r and the r commander, Rcmdr, Rcmdr r

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Data analysis using R and the R-commander (Rcmdr)

1 data analysis using R and the R-commander ( rcmdr ). Graeme D. Hutcheson Manchester University Chapter 1. R and the rcmdr R provides a powerful and comprehensive system for analysing data and when used in conjunction with the R-commander (a graphical user interface, commonly known as rcmdr ) it also provides one that is easy and intuitive to use. Basically, R provides the engine that carries out the analyses and rcmdr provides a convenient way for users to input commands. The rcmdr program enables analysts to access a selection of commonly-used R commands using a simple interface that should be familiar to most computer users. It also serves the important role of helping users to implement R commands and develop their knowledge and expertise in using the command line an important skill for those wishing to exploit the full power of the program.

2 Installation The following section explain how R and the rcmdr user-interface can be installed on a number of computer platforms. As rcmdr is an add-on package for R, it needs to be installed after the main R software. Once R has been installed and is running, rcmdr can then be installed from the R-console. It is not necessary to go into a lot of detail here about installing R and the rcmdr as there are many excellent descriptions of this available on-line1 and in a number of published books (see, for example Horton and Kleinman, 2011; Fox and Weisberg, 2011; Zuur et al., 2009). Some minimal instructions are, however, provided below. Installing R. Information about installing R can be found on the web at the R homepage which provides lots of information about the R.

3 1 As R and the rcmdr are constantly evolving and developing, along with the computer platforms it is installed on, details about installation may be subject to change. Users are therefore recommended to get the most up to date information about installing the software for their particular computing platform directly from the internet (see, for example, http: and ). 1. 2 1. R AND THE rcmdr . project and also directs users to one of the CRAN sites (the Comprehensive R. Archive Network) that have been set up on many servers across the world in order for users to download the software. CRAN provides all files necessary to install R on a number of different computing platforms (Linux, MacOS. X and Windows) along with detailed information about installation and also offers manuals and contributed documentation in a number of langauges and for a number of specific disciplines.

4 Linux/Unix On the CRAN site, select the Download R for Linux link. R is available for a number of distributions (for example, Debian, RedHat, Suse and Ubuntu). and users who are familiar with Linux should have little difficulty in installing the basic R package using the detailed instructions provided on-line. Once installed, the program is run by entering R' into a terminal. MacOS X. On the CRAN site, select the Download R for MacOS X link. To install the basic R package, double-click the file ( indicates the current software version these numbers change with updates). To use the rcmdr GUI, two other packages, found in the tools directory, should also be installed. These are the and the packages which can both be installed by double-clicking.

5 Once installed, R. is run via the program-finder. Windows On the CRAN site, select the Download R for Windows link. The basic R package can be installed from the file ( indicates the current software version these numbers change with updates). The R. program can then be run from the R-icon on the desktop, which is provided as part of the standard installation procedure. Windows allows the R program to run in one big window, or in a number of separate windows (the output depicted in this book uses multiple windows). The selection of which to use can be made during the installation process (from the customized startup options) or by using the GUI ' option from the R-console. When the R program is run (on all platforms), a window opens up (the R-console) which provides an interface to the R language.

6 At first glance, the R-console looks remarkably unimpressive, as it just offers a small window with some text and a command-line prompt (see Figure ). The text provides some basic information about the program, it's version number, information about the license and how it can be cited (see the citation( ) command). The text also gives some information about getting some help and some of the demonstration programs that can be run directly from the command line. INSTALLATION 3. Figure : The R-console provides a simple interface that allows text com- mands to be entered into R (enter them on the command line after the >. prompt. Note that the console shown here is one available on the Linux operating system consoles for other operating systems may look slightly different and have different pull-down menu options, but all offer the same basic functionality.)

7 The comprehensive help system will be of particular interest to new users and can be activated by typing ( ) into the R-console, or by using the pull-down Help menu. R-console ( ). This is a particularly useful method of accessing help as it operates through a web-browser and offers a whole range of services including access to manuals, documentation on packages that have been loaded, frequently asked questions and a key-word search utility to search all of the available help files. We can see R in action by running one of the suggested commands from the opening text. The demo( ) command offers a number of demonstrations depending on which packages have been loaded. Typing demo( ) into the R-console displays a list of them.

8 A basic installation of R includes a number of demonstrations such as catching and handling errors', examples from linear and generalized linear models' and a demonstration of the graphical capabilities of R. As an example, the graphics demonstration can be run by simply entering the 4 1. R AND THE rcmdr . Figure : The demo(graphics) command demonstrates some of the graph- ical capabilities of R. The R-console shows the commands produced auto- matically by the demo(graphics) command to obtain the graphic, which is shown in the foreground output window. The commands demonstrate how a simple plot may be produced and also how lines, points and titles can be defined and amended. command R-console demo(graphics). into the R-console.

9 This command provides R with the instructions needed to produce a number of graphics and these are shown in the R-console. Figure shows a part of the commands from the demo(graphics) function and one of the resulting graphics. The commands used to draw the graphic are rela- tively straight forward and users should have little difficulty in understanding them. For example, the basic plot is drawn using the plot( ) command with automatic printing of the labels and data points suppressed (ann = FALSE, type = n') as these are subsequently added to the plot using the xlab= ', lines( ) and points( ) commands. Figure provides an effective demon- INSTALLATION 5. stration of the great level of control that the user has over the graphic and shows how the size, colour and opacity of the labels, points and lines can all be controlled.

10 Although these commands are easy to understand and modify, the use of a text-based interface can be quite alien to new users, who are often more used to a mouse-driven environment. Although very powerful and versatile, text-based commands can prove to be a barrier for some using the program, at least at first. There are, however, a number of interfaces that have been developed for R to allow mouse-driven menu selections to be used (for a comprehensive list of these, see ). This book makes extensive use of one of these graphical user interfaces . the R-commander ( rcmdr ), a program that provides an interface for R that enables commands to be selected using a mouse-driven point-and-click menu system. Installing the R-commander rcmdr is a graphical interface for R which is written and maintained by John Fox (Fox, 2005, 2012a).


Related search queries