Support files, eBooks, discount offers and more
You might want to visit www.packtpub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at > for more details.
At www.packtpub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
Free Access for Packt account holders
If you have an account with Packt at www.packtpub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
Chapter 1. Instant R Starter
Welcome to Instant R Starter . This book has been created especially to provide you with all the information that you need to set up with R. You will learn the basics of R, get started with manipulation of R objects, write your own functions, and discover some tips and tricks for using R.
This document contains the following sections:
So, what is R? shows you what R actually is, what you can do with it, and why its so great.
Installation teaches you how to download and install R with a few easy steps and then set it up so that you can use it as soon as possible.
Quick start R language will make you familiar with the R language. You will learn how to create different objects (vectors, matrices, data frames) and you will see some practical examples of their manipulation and use.
Top 5 features you need to know about will teach you how to perform five tasks with the most important features of R. By the end of this section you will be able to perform data input and output in the system, use flow control and loops, write your own functions and debug them, and create basic plots.
People and places you should get to know provides you with many useful links to the projects page and forums, as well as a number of helpful guides, tutorials, blogs, and the Twitter feeds about R, as every open-source project is centered around a community of users.
So, what is R?
R is a high-level language and environment for data analysis and visualization. It provides an environment in which you can perform statistical analysis and produce high-quality graphics. It is actually a complete programming language derived from the statistical programming language S. It has been developed and is maintained by a core of statistical programmers, with the support of a large community of users. It is most widely used for statistical computing and graphics, but is a fully functional programming language well suited for scientific programming, data management, and data visualization in general.
The interaction with the R system is mainly command-driven, with the user typing in text and asking R to execute the specific command. As soon as you start R, a session will be opened on which the commands may be introduced and the expression executed. Complex procedures can be implemented in the scripts, which are executed as soon as they are loaded into the system or, more efficiently, as functions, which can be loaded in the system and used when needed.
Getting help
R can do a lot more than what a typical beginner can be expected to need. R also comes with extensive online help in text form as well as in HTML files. The help pages can be accessed via the Help section in the cascade menu or via the help.start()
command on the console. You will notice that all the help pages present the same structure, and if they don't appear to be clear at a first glance, they contain all the main information you will need. Normally, all the functions as well as the datasets contained in the packages have their own specific help file. The easiest way to access such pages is to call the