A matrix is a two-dimensional arrangement of vectors of the same type. Like vectors in R, the matrix is restricted to one data type. In this recipe, you will learn how to create a matrix, how to access its elements, and understand a few notes on matrix operations.
Creating a matrix and accessing its properties
Getting ready
To get started with this recipe, you must have R installed on your computer. You also need to understand the structure of a matrix and various operations. There is no library required for this recipe, but if you are interested in advanced matrix algebra, then you might consider the See also section of this recipe. A matrix is considered as a two-dimensional grid where each cell is represented by a row and...