title: Convert a matrix in R into a upper triangular/lower triangular matrix with those corresponding entries
body: <p>I have a symmetric matrix and I want to convert it into a upper triangular/lower triangular matrix in R. Is there a way of doing this ?</p>
  
  <p>I am not able to do this using <code>upper.tri</code> and <code>lower.tri</code>. Using these gives me a matrix with entries as either <code>TRUE</code> or <code>FALSE</code>.</p>