How to create diagonal and unequal matrix in R? -


i need create diagonal (6,6) matrix in r using valuse 1.2, 12.1, 6.5, 9.4, 4.9, 2.4. how should r code?

use diag:

diag(c(1.2, 12.1, 6.5, 9.4, 4.9, 2.4)) 

Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -