A matrix in R Programming is an object whose elements are arranged in a two-dimensional layout in the shape of a rectangle. The arranged data type could be anything from numeric, logical, or even characters. The syntax for creating a matrix in R R Programming is mentioned below for you to look into.
matrix(data, nrow, ncol, byrow, dimnames)
If you wish to master R Programming, and you are just starting out, then I would recommend you to take up this end-to-end R certification course from Intellipaat. That offers you instructor-led training and guided projects to help you gain the required practical skills. Watch our YouTube video on Learn R Language from our experts and get started.