- 1
Help me pls : R
I was stuck in this code Coach for days/months please help me My code : data <- c(1, 2, 3, 4, 5, 6, 7, 8, 9,10) A <- matrix(data, nrow = 3, ncol = 4) A_T <- t(A) print("transpose of A") print(A_T) Question: matrix operations are often used in data manipulation and processing. to solve this task, you need to define a matrix with the given number of rows and fill it with the numbers 1 to 10. after that, output the transpose of the resulting matrix. sample input 3 sample output [,1] [,2] [,3] [1,] 1 2 3 [2,] 4 5 6 [3,] 7 8 9 [4,] 10 1 2
6 Answers
+ 2
READ the task description carefully:
* Only output the result, not "transpose of A"
* Only specify the number of rows using the āāāinputāāā, do not hard-code nrow and do not specify ncol
+ 1
You asked for help. I helped you by hinting at the issues. Please read my reply carefully and try to implement it in your code. Then show us your new code.
+ 1
Hrithika Reddy So redo the lesson. You should get able to correct code.
Try. Then tell us where you got stuck. This teaches you a lot more than asking others to solve it for you.
- 1
I'm not able to correct them , don't misunderstand me, if u give me the code I can understand my mistakes .
- 2
Can u please send me the correct code
- 2
Sure . But it doesn't matter how I redo I can't figure out the mistake. I know the concept
if u can do it , I will check my mistakes and give it a try .
please don't comment in my question if u have no answer and don't waste my time don't take it personally