In this chapter, we are going to cover the basic data structure in R—a vector. Understanding vectors is the foundation for all the subsequent chapters. You will learn how to perform efficient operations on numeric and logical vectors and how to create subsets. After this, you will learn how to write custom functions in order to expand and customize R's capabilities. Working with dates and time series and the use of graphical functions are introduced at the end of this chapter.
In this chapter, we'll cover the following topics:
Creating, saving, and examining the three main types of vectors
The principles of performing operations on vectors in R
Using functions that have more than one argument
Creating subsets of vectors
Dealing with missing values in vectors
Writing new functions
Working with dates
Displaying and saving graphical output