title: Is there a sensible way to do something like docstrings in R?
body: <p>This is not just a coding style question. If you know python (and I think also Ruby has something like this), you can have a docstring in a function, such that you can readily get that string by issuing a "help" command. e.g.:</p>
  
  <pre><code>def something(t=None):
      '''Do something, perhaps to t
  
      t : a thing
          You may not want to do this
      '''
      if t is not None:
          return t ** 2
      else:
          return 'Or maybe not'
  </code></pre>
  
  <p>Then <code>help(something)</code> returns the following:</p>
  
  <pre><code>Help on function something in module __main__:
  
  something(t=None)
      Do something, perhaps to t
  
      t : a thing
          You may not want to do this
  </code></pre>
  
  <p>The way things work in R, you can get the full text of the defined code snippet, so you could see comments (including those at the beginning of the function), but that can be a lot of scrolling and visual filtering. Is there any better way?</p>