O'Reilly logo

A Course in Statistics with R by B. G. Manjunath, Suresh Ramaiah, Prabhanjan N. Tattar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2The R Basics

Package(s): gdata, foreign, MASS, e1071

2.1 Introduction

A better way of becoming familiar with a software is to start with simple and useful programs. In this chapter, we aim to make the reader feel at home with the R software. The reader often struggles with the syntax of a software, and it is essentially this shortcoming that the reader will overcome after going through the later sections. It should always be remembered that it is not just the beginner, even the experts make mistakes when it comes to the structure of the syntax, and this is probably the reason why the “Backspace” key on the keyboard is always there, apart from many other keys round about for correcting previously submitted commands and/or programs.

Section 2.2 begins with the R preliminaries. The main topics considered here discuss and illustrate using R for finding absolute values, remainders, rounding numbers to specified number of digits, basic arithmetic, etc. Trigonometric functions and complex numbers are considered too, and the computations of factors and combinatorics is dealt with in this section. Useful R functions are then dealt with in Section 2.3. Summary of R objects, deliberating on the type of the R class, dealing with missing observations, and basic control options for writing detailed R programs have been addressed here. The importance of vectors and matrices are almost all prevalent in data analysis, and forms the major content of Section 2.4. Importing data from ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required