Transpose Matrix in R
# R program for Transpose of a Matrix
# create a matrix with 2 rows
# using matrix() method
M <- matrix(1:6, nrow = 2)
# print the original matrix
print(M)
# transpose of matrix
# using t() function.
t <- t(M)
# print the transpose matrix
print(t)