create matrix in r
matrix(c(3:8), nrow = 2)
#Returns
#>
[,1] [,2] [,3]
[1,] 3 5 7
[2,] 4 6 8
matrix(c(3:8), ncol = 2)
#Returns
#>
[,1] [,2]
[1,] 3 6
[2,] 4 7
[3,] 5 8
create matrix in r
matrix(c(3:8), nrow = 2)
#Returns
#>
[,1] [,2] [,3]
[1,] 3 5 7
[2,] 4 6 8
matrix(c(3:8), ncol = 2)
#Returns
#>
[,1] [,2]
[1,] 3 6
[2,] 4 7
[3,] 5 8
how to write a 10x10 matrix in rstudio
ranVal= sample(1:10,100,replace =T) #creating 10X10 with random values
M=matrix(ranVal,nrow=10)
print (M)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us