A Short Introduction to R Programming
In R, data structures are referred to as objects. Each object can hold vectors as mentioned above, scalars, matrices, arrays, data frames and lists. Amongst all the objects, the list is the most special. This is because a list can hold any or all data types.
Matrices
Matrices are a single two-dimensional data set. And one can create a matrix using the matrix() function. A matrix contains a vector element and nrow & ncol represents the row and column dimensions of the matrix.