Module 6 Assignment

 Module 6 Assignment


    This week I successfully followed the instructions for module 6. I created two matrices, A and B, and I added and subtracted them. Next, I built a matrix with 4,1,2,3 along the diagonal using the diag() function and using concatenation to get the numbers in the desired order. Lastly, I generated the desired matrix by creating matrix e with diagonal 3s with 4 rows and 4 columns (I figured out to start with a 4X4 to add the desired rows and columns to end in a 5X5). I added a row of 1s to the top and a column of 2s to the front using rbind() and cbind(). I learned that order in the arguments matters. Lastly, I changed the value in row 1 column 1 in matrix g to a 3. The result is the desired vector. 


    Creating the desired vector was the most difficult part of the assignment. I had to look through my notes on matrices to figure out the best functions to use to add the numbers. I also spent a lot of time figuring out in which order to add the numbers. 

Weekly readings:
  • Norman, M. (2011) The Art of R Programming. Chapters 9-10 pp. 207-231.
  • Wickham, H. (2015) R Packages, organize, test, document and share your code Chapters 2-3. Special attention to Top Level Code - pp 27-31

Comments

Popular posts from this blog

Module 10 Assignment

Module 1 Assignment