Assignment
Check for the assignment sir

x=c(9,10,11,12)
y=c(13,14,15,16)
matrixA=matrix(x,y,nrow = 4,ncol = 2)
print(matrixA)
     [,1] [,2]
[1,]    9   10
[2,]   11   12
[3,]    9   10
[4,]   11   12

R Creating-Matrices-using-Data-Frames 09-10 min 40-50 sec 15-05-20, 8:52 p.m. Alamu

Answers:

While pasting the content, please use Ctrl + Shift + V
16-05-20, 3:32 p.m. sudhakarst
x=c(9,10,11,12)
y=c(13,14,15,16)
matrixA=matrix(x,y,nrow = 4,ncol = 2) print(matrixA) [,1] [,2] [1,] 9 10 [2,] 11 12 [3,] 9 10 [4,] 11 12
16-05-20, 7:26 p.m. Alamu
Sorry for repeating the same mistake sir
 
matrixB=matrix(nrow=4,ncol=2,data = c(9,10,11,12,13,14,15,16))
print(matrixB)
     [,1] [,2]
[1,]    9   13
[2,]   10   14
[3,]   11   15
[4,]   12   16

Sir i have doubt if i type the above coding i am getting the above solution but the assignment was to create two vectors so i have the coding as

 x=c(9,10,11,12)
y=c(13,14,15,16)
matrixB=matrix(nrow=4,ncol=2,x,y)
 print(matrixB)
     [,1] [,2]
[1,]    9   10
[2,]   11   12
[3,]    9   10
[4,]   11   12

i am getting like above solution sir pls correct me sir
16-05-20, 7:36 p.m. Alamu


Click here to reply/comment online