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.
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
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
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 10need an explanation for this answer? contact us directly to get an explanation for this answer