R TUTORIAL, Part I: Arrays

R is a statistical analyzation language, and that means it is very good at data manipulation and data analyzation. One key way to analyze data is through plotting, and R excels in this field.

\[ y' = f(x,y), \qquad y(x_0 ) = y_0 . \]

Arrays

An array can be considered as a multiply subscripted collection of data entries, for example, numeric. R allows simple facilities for creating and handling arrays, and in particular the special case of matrices (that is a topic of special section in tutorial II). A dimension vector is a vector of non-negative integers. If its length is k, then the array is k-dimensional, e.g. a matrix is a 2-dimensional array. The dimensions are indexed from one up to the values given in the dimension vector. Arrays can be one-dimensional: such arrays are usually treated in the same way as vectors.

     [,1] [,2] [,3]
[1,]    1    2    3
[2,]    4    5    6
[3,]    7    8    9

 

  1. Schiesser, W.E., An Introductory Comparison of Matlab and R, Lehigh University, Bethlehem, USA.
  2. Soetaert, K, Cash, J., Mazzia, F., Solving Differential Equations in R, 2012, Springer, Heidelberg New York Dordrecht London