June 2007
Beginner to intermediate
950 pages
27h 8m
English
Objects obtain values in R by assignment (‘x gets a value’). This is achieved by the gets arrow <- which is a composite symbol made up from ‘less than’ and ‘minus’ with no space between them. Thus, to create a scalar constant x with value 5 we type
x<-5
and not x = 5. Notice that there is a potential ambiguity if you get the spacing wrong. Compare our x<-5, ‘x gets 5’, with x <-5 which is a logical question, asking ‘is x less than minus 5?’ and producing the answer TRUE or FALSE.
Read now
Unlock full access