title: How to reverse a number in R
body: <p>I want to write a function to reverse the order of any numbers. Here is what I have but it doesn't work. Please help me!</p>
  
  <pre><code>n=123
  rev_number=function(n){
   m=strsplit(as.character(n),"")
   if (m==rev(m)) print("reversed number")
  }
  </code></pre>
  
  <p>The desired output is <code>n=321</code></p>