title: R equivalent to the Python function "dir"?
body: <p>Is there a function in R that can tell me the attributes of a given object (or class)?</p>
  
  <p>Consider the "dir" function in python when passed the <code>file</code> class:</p>
  
  <pre><code>&gt;&gt;&gt; dir(file)
  ['__class__', '__delattr__', '__doc__', '__enter__', '__exit__', 
   '__format__', '__getattribute__', '__hash__', '__init__', '__iter__',
   '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__',
   '__sizeof__', '__str__', '__subclasshook__', 'close', 'closed',
   'encoding', 'errors', 'fileno', 'flush', 'isatty', 'mode', 'name',
   'newlines', 'next', 'read', 'readinto', 'readline', 'readlines',
   'seek', 'soft space', 'tell', 'truncate', 'write', 'writelines',
   'xreadlines']
  </code></pre>
  
  <p>Maybe there is an equivalent of <code>type</code> as well(?)</p>
  
  <pre><code>&gt;&gt;&gt; type(1)
  &lt;type 'int'&gt;
  </code></pre>