Q:

Write a R program to create an array with three columns, three rows, and two "tables", taking two vectors as input to the array. Print the array

-1

Write a R program to create an array with three columns, three rows, and two "tables", taking two vectors as input to the array. Print the array.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

v1 = c(1, 3, 5, 7)
v2 = c(2, 4, 6, 8, 10)
arra1 = array(c(v1, v2),dim = c(3,3,2))
print(arra1)

Sample Output:

, , 1

     [,1] [,2] [,3]
[1,]    1    7    6
[2,]    3    2    8
[3,]    5    4   10

, , 2

     [,1] [,2] [,3]
[1,]    1    7    6
[2,]    3    2    8
[3,]    5    4   10

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now