A data frame is a matrix-like structure to store data tables. It is a list of vectors of equal length […]
Category: R Data Types
Adding a row or a column to an existing Matrix in R
Problem1: Add a row to an existing Matrix Solution: We can use the function rbind() to add a row to […]
Assignment on Matrix in R
Let’s use an example of dinner plans for this assignment. We have done this with Vectors. But this time, we […]
Accessing the Matrix Elements in R
Problem: Access the elements of a Matrix Solution: We can use the square brackets ( [] ) to select one […]
Naming A Matrix in R
Problem: Naming the elements of a Matrix Solution:We can add names for the rows and the columns of a matrix. Adding […]
Creating a Matrix in R
A matrix is a two-dimensional array in R. It contains the collection of elements of the same data type (numeric, […]