IN R
a <- (seq(4,100, by =4))
b<- (seq(.8,40, by = .8))
1. Combine a and b as columns to create a new matrix.
2. combine a and b as rows to create a new matrix.
a)
cbind(a,b)
Output
a b [1,] 4 0.8 [2,] 8 1.6 [3,] 12 2.4 [4,] 16 3.2 [5,] 20 4.0 [6,] 24 4.8 [7,] 28 5.6 [8,] 32 6.4 [9,] 36 7.2 [10,] 40 8.0 [11,] 44 8.8 [12,] 48 9.6 [13,] 52 10.4 [14,] 56 11.2 [15,] 60 12.0 [16,] 64 12.8 [17,] 68 13.6 [18,] 72 14.4 [19,] 76 15.2 [20,] 80 16.0 [21,] 84 16.8 [22,] 88 17.6 [23,] 92 18.4 [24,] 96 19.2 [25,] 100 20.0 [26,] 4 20.8 [27,] 8 21.6 [28,] 12 22.4 [29,] 16 23.2 [30,] 20 24.0 [31,] 24 24.8 [32,] 28 25.6 [33,] 32 26.4 [34,] 36 27.2 [35,] 40 28.0 [36,] 44 28.8 [37,] 48 29.6 [38,] 52 30.4 [39,] 56 31.2 [40,] 60 32.0 [41,] 64 32.8 [42,] 68 33.6 [43,] 72 34.4 [44,] 76 35.2 [45,] 80 36.0 [46,] 84 36.8 [47,] 88 37.6 [48,] 92 38.4 [49,] 96 39.2 [50,] 100 40.0
b)
rbind(a,b)
Get Answers For Free
Most questions answered within 1 hours.