b <- 1:5 m <- matrix(c(b, b^2, b^3, b^4), 5, 4) print(m) tm <- t(m) print(tm)