Basic Command For R

Basic Command For R - Chapter 5 INTRODUCTION TO R 5.1...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 5 INTRODUCTION TO R 5.1 Obtaining and Installing R 1. Get on the Internet and go to the web address < http://lib.stat.cmu.edu/R/CRAN/ > . This is the “official” site of the The Comprehensive R Archive Network (CRAN). Bookmark this address. Lots of information (manuals, answers to frequently asked questions, etc.) can be downloaded from this site. 2. There is a box labeled “Download and Install R”. In that box, click on the link Windows (95 and later) . 3. Click on the subdirectory link named base . The standard collection of R functions and packages is called base R . 4. The link README.R-2.4.1 contains a brief synopsis on installation and other instructions for R version 2.4.1 for Windows. This file contains information on installing R. You shouldn’t need to look at this file, but take a look if you get into trouble. 5. Click on the link R-2.4.1-win32.exe . Download this setup program to your hard drive. 6. Exit from the Internet and open Windows Explorer. Go to the folder in which you saved R-2.4.1-win32.exe and run the program. 7. You will be guided through the installation by a Setup Wizard. 8. CRAN contains many excellent resources for using R. One resource in particular is of special note. At the CRAN home page, click on the link Contributed . This link is on the left-hand-side of the page. Under the heading “Documents with more than 100 pages,” there are links that allow you to download or to use online a nifty text on using R for introductory statistics entitled “Simple R”, by John Veranzi. This text is also available for sale as a hardbound book through CRC Press. See me if you are interested in looking at it. Also, various manuals can be downloaded by clicking on Manuals and then on the manual of choice. The short (99 pages) manual titled “An Introduction to R” may be useful. 9. Special-purpose software routines are bundled as separate “packages”. Some packages are automatically downloaded when base R is downloaded. To download additional packages, execute R on your PC and then click on “Packages” (top menu). Click on “Install package(s)”, choose a USA location to retrieve the package(s), and then choose the package(s) that you want to download. The packages that you will need for this course are the following: (a) MASS (this package does not need to be downloaded separately because it is part of base R), (b) lattice (this package does need to be downloaded separately), and (c) pastecs (this package does need to be downloaded separately). When it is necessary to actually use a package, click on “Packages”, then “Load package”, and choose the package you need. If you prefer to do it manually, the functions “library” and “require” also load add-on packages. 13
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
5.2 Getting Help in R There are several ways to learn about R and to get help on particular applications. To get started, I suggest that you read the first three sections (18 pages) of the “Simple R” text. Useful functions for getting help within an R session include the following.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern