saving . . . saved Assignment has been deleted. Assignment has been hidden .
Assignment
Title
Question
Check for the assignment sir

<pre class="GNKRCKGCGSB" id="rstudio_console_output" style="font-family: 'Lucida Console'; font-size: 10pt !important; outline: none; border: none; word-break: break-all; margin: 0px; -webkit-user-select: text; white-space: pre-wrap !important; line-height: 15px; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: -webkit-left; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" tabindex="0"><span><span class="GNKRCKGCMRB ace_keyword" style="color: blue;">x=c(9,10,11,12) </span><span class="GNKRCKGCMSB ace_keyword" style="color: blue; white-space: pre; -webkit-user-select: text;"></span><span class="GNKRCKGCMRB ace_keyword" style="color: blue;">y=c(13,14,15,16) </span><span class="GNKRCKGCMSB ace_keyword" style="color: blue; white-space: pre; -webkit-user-select: text;"></span><span class="GNKRCKGCMRB ace_keyword" style="color: blue;">matrixA=matrix(x,y,nrow = 4,ncol = 2) </span><span class="GNKRCKGCMSB ace_keyword" style="color: blue; white-space: pre; -webkit-user-select: text;"></span><span class="GNKRCKGCMRB ace_keyword" style="color: blue;">print(matrixA) </span><span class="GNKRCKGCGSB" style="outline: none; border: none; word-break: break-all; margin: 0px; -webkit-user-select: text; white-space: pre-wrap !important;"> [,1] [,2] [1,] 9 10 [2,] 11 12 [3,] 9 10 [4,] 11 12</span></span></pre>

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
<pre class="GNKRCKGCGSB" id="rstudio_console_output" style="font-family: 'Lucida Console'; font-size: 10pt !important; outline: none; border: none; word-break: break-all; margin: 0px; -webkit-user-select: text; white-space: pre-wrap !important; line-height: 15px; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: -webkit-left; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);" tabindex="0"><span><span class="GNKRCKGCMRB ace_keyword" style="color: blue;">x=c(9,10,11,12) </span><span class="GNKRCKGCMSB ace_keyword" style="color: blue; white-space: pre; -webkit-user-select: text;"></span><span class="GNKRCKGCMRB ace_keyword" style="color: blue;">y=c(13,14,15,16)
</span></span><span><span class="GNKRCKGCMRB ace_keyword" style="color: blue;">matrixA=matrix(x,y,nrow = 4,ncol = 2) </span></span><span><span class="GNKRCKGCMSB ace_keyword" style="color: blue; white-space: pre; -webkit-user-select: text;"> </span><span class="GNKRCKGCMRB ace_keyword" style="color: blue;">print(matrixA) </span><span class="GNKRCKGCGSB" style="outline: none; border: none; word-break: break-all; margin: 0px; -webkit-user-select: text; white-space: pre-wrap !important;"> [,1] [,2] [1,] 9 10 [2,] 11 12 [3,] 9 10 [4,] 11 12</span></span>
<span><span class="GNKRCKGCMRB ace_keyword" style="color: blue;"></span></span></pre>
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

Login to add comment


Log-in to answer to this question.