Exercise 2: Usage of matrices

Description

Provide in the plain text R commands that finds/solves the following:

Don't use plagiarized sources. Get Your Custom Assignment on
Exercise 2: Usage of matrices
From as Little as $13/Page

Create a matrix named m1 with three rows and five columns and all the numeric (integer) values from 6 to 20!
Multiply all elements in m1 by 0.5! Overwrite the matrix m1 with the result!
Create another matrix m2 with one row and five columns and all the numeric (integer) values from 1 to 5!
Calculate the sum of all elements in m2!
Combine m1 and m2 with rbing(). Save the result as m3 and check the dimension of the new matrix!
Index the 5th column of m3!
Index the 2nd and 4th lines of m3!
Calculate the sums for all columns in m3!
Calculate the standard deviation for the 3rd column in m3!
From m3, index the element in the 2nd column and 2nd line and all eight adjacent elements! Save the result as m4 and examine its object class!

For submission, save the command as a plain text file, save the matrix data as .csv plain text file, and submit those two files.


Unformatted Attachment Preview

R Programming
Week 2.1: The R language – “Words” and “Sentences”
Matrices and multidimensional arrays
Factors
Lists
Data frames
Attributes of R objects
Saving and loading data
Looking at data
Plotting
Matrices and multidimensional arrays
Create a new matrix using the matrix() or as.matrix() constructors
matrix(1:15, ncol = 3)
##
[,1] [,2] [,3]
## [1,] 1 6 11
## [2,] 2 7 12
## [3,] 3 8 13
## [4,] 4 9 14
## [5,] 5 10 15
matrix(1:15, nrow = 3)
## [,1] [,2] [,3] [,4] [,5]
## [1,] 1 4 7 10 13
## [2,] 2 5 8 11 14
## [3,] 3 6 9 12 15
Matrix Constructor
A
Purchase answer to see full
attachment