
OBJECTS
 R has five basic classes of objects:
 Character
 Numeric
 Integer
 Complex
 Logical
However, the most basic object is a vector.
 There are two things which you should remember when dealing with vectors.
 A vector can only contain objects of the same class.
 AND there is an exception to this, a list. A list looks like a vector, but can have different classes.
To create an empty vector use the following function:
^{?}View Code R
vector() 
Vectors can be created by using the following:
^{?}View Code R
c() # used to concatenate individual values together : # to create a sequence, such as 1:10 seq() # to create more complex sequences rep() # replicates values sort() # ordering elements in a vector order() # ordering elements in a vector 
An example of using rep()
^{?}View Code R
rep(5,2) #a vector of two fives [1] 5 5 
An example of using c()
^{?}View Code R
c(3,2,1) # vector of three numeric elements in that order [1] 3 2 1 
An example of using seq()
^{?}View Code R
seq(4,20, by = 2) [1] 4 6 8 10 12 14 16 18 20 seq(1,length = 20, by =4) [1] 1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 