Categories:
Cloud (204)
Entertainment (11)
Facebook (43)
General (50)
Life (31)
Programming (64)
Technology (430)
Testing (4)
Tools (488)
Twitter (5)
Wearable (26)
Web Design (44)
Collections:
Other Resources:
Data Structure - Matrix
What is a Matrix?
✍: FYIcenter.com
Matrix is an extension of vector into 2 dimensions
1. Create a matrix object with the matrix() function -
> m = matrix(1:20, nrow=5,ncol=4)
> m
[,1] [,2] [,3] [,4]
[1,] 1 6 11 16
[2,] 2 7 12 17
[3,] 3 8 13 18
[4,] 4 9 14 19
[5,] 5 10 15 20
> typeof(m)
[1] "integer"
> is.matrix(m)
[1] TRUE
> is.vector(m)
[1] FALSE
2. Get matrix length, dimensions and members -
> m = matrix(1:20, nrow=5,ncol=4) > length(m) [1] 20 > dim(m) [1] 5 4 > m[3,2] [1] 8
2023-05-31, 847🔥, 0💬
Popular Posts:
Why I getting the "Error! No text of specified style in document." in Microsoft Word? You are gettin...
How to login to Facebook with a Web browser? If you want to login to Facebook with a Web browser, yo...
Why am I getting the "You now have two copies of a file" error from OneDrive for Windows? You will g...
I have an Apple iPad Air Model MD788C/A. Is it good? Yes. Apple iPad Air Model MD788C/A is a very go...
What is "Microsoft SharePoint Server Colleague Import Add-in" COM Add-in in Outlook 2013? Should I d...