Learn R Programming

optimbase (version 1.0-10)

transpose: Vector and Matrix Transpose

Description

transpose is a wrapper function around the t function, which tranposes matrices. Contrary to t, transpose processes vectors as if they were row matrices.

Usage

transpose(object = NULL)

Arguments

object

A vector or a matrix.

Value

Return a matrix which is the exact transpose of the vector or matrix x

See Also

t

Examples

Run this code
# NOT RUN {
  1:6
  t(1:6)
  transpose(1:6)
  mat <- matrix(1:15,nrow=5,ncol=3)
  mat
  transpose(mat)
# }

Run the code above in your browser using DataLab