Matrix Notation Exercises
In R we have vectors and matrices. You can create your own vectors with the function c.
They are also the output of many functions such as:
You can turn vectors into matrices using functions such as rbind, cbind or matrix.
Create the matrix from the vector 1:1000 like this:
X = matrix(1:1000,100,10)
What is the entry in row 25, column 3?
Using the function cbind, create a 10 x 5 matrix with first column
x=1:10. Then add
5*xto columns 2 through 5. What is the sum of the elements of the 7th row?
Which of the following creates a matrix with multiples of 3 in the third column?