Vector and scalar

# Vector ------------------------------------------------ ---------------------- 

## composition c () function to create the vector 
a <- c (1,2,5,3,6, -2,4 ) numeric # 
b <- c ( 'one' , "two", 'three') # character 
c <- c (TRUE, TRUE , F, T, F) # logical

  

# Scalar, vector contains only one element, for example, 
F <-. 3 


A [. 3] 
A [-1] 
A [C (-1,3,5)] 
A [0] #numeric (0) no value 
a [2 : 6]

  

Guess you like

Origin www.cnblogs.com/dogfaraway/p/11505614.html