title: view source code in R
body: <p>How do I view source code in R? For example, for function <code>portfolio.optim</code></p>
  
  <pre><code>&gt; require(tseries)
  &gt; portfolio.optim
  function (x, ...) 
  UseMethod("portfolio.optim")
  &lt;environment: namespace:tseries&gt;
  
  &gt; methods(portfolio.optim)
  [1] portfolio.optim.default* portfolio.optim.ts*     
  
  Non-visible functions are asterisked
  &gt; portfolio.optim.ts
  Error: object 'portfolio.optim.ts' not found
  &gt; portfolio.optim.default
  Error: object 'portfolio.optim.default' not found
  </code></pre>
  
  <p>When I install R package locally, does it download source code as well? Where does it store on the computer? Does anyone know?</p>