Answers for "Transpose Matrix in R"

0

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)
Posted by: Guest on March-30-2022

Browse Popular Code Answers by Language