Slip 18 - E) Write an R program to create three vectors a,b,c with 3 integers. Combine the three vectors to become a 3×3 matrix where each column represents a vector. Print the content of the matrix.

Solution:

a<-c(10,20,30)
b<-c(40,50,60)
c<-c(70,80,90)
m<-cbind(a,b,c)
print("Content of the matrix:")
print(m)

Post a Comment

0 Comments