title: Assign error statement to variable in R
body: <p>My doubt is to assign an error statement to variable or an object in R.
  e.g. suppose i am executing statement which is gonna throw an error, i want to save that error statement somewhere so that later i can debug the code. e.g.:</p>
  
  <pre><code>x*3   #faulty statement
  Error: object 'x' not found  # error thrown because x dont exist
  </code></pre>
  
  <p>but is it possible to save this error statement "object 'x' not found" to variable or to text file?</p>