title: How to transpose a matrix without using t() function in r
body: <p>I know theres a function on R that allows you to transpose any matrix but was wondering how I would go about transposing a matrix without using this (ie. making own function) </p>
  
  <p>How would I write this as my own function? </p>
  
  <pre><code>transpose &lt;- function(M)
  
  M &lt;- matrix(data, nrow= (), ncol= (), byrow = TRUE) 
  output &lt;- matrix(data, nrow=ncol, ncol=nrow, brow = FALSE)
  </code></pre>
  
  <p>Please note I've only just started using r so please don't be harsh. </p>