title: unused arguments in getPortfolio when using R
body: <p>I'm a beginner with R, and I'm trying to follow the code I found online to create an optimal portfolio. link to the page im following: <a href="http://faculty.washington.edu/ezivot/econ424/portfoliofunctions.pdf" rel="nofollow noreferrer">http://faculty.washington.edu/ezivot/econ424/portfoliofunctions.pdf</a> .when I get to the part with getPortfolio and I specify the arguments, I get an error message about unused arguments-what am I doing wrong? Below is the code im following up to the part where I get stuck -it says the arguments specified in the getPortfolio function are unused?</p>
  
  <pre><code>&gt; asset.names &lt;- c("MSFT", "NORD", "SBUX")
  &gt; er &lt;- c(0.0427, 0.0015, 0.0285)
  &gt; names(er) &lt;- asset.names
  &gt; covmat &lt;- matrix(c(0.0
  100, 0.0018, 0.0011,
  +    0.0018, 0.0109, 0.0026,
  +    0.0011, 0.0026, 0.0199),
  +  nrow=3, ncol=3)
  &gt; rk.free &lt;- 0.005
  &gt; dimnames(covmat)&lt;- list(asset.names, asset.names)
  &gt; ew = rep(1,3)/3
  &gt; equalWeight.portfolio = getPortfolio(er=er,cov.mat=covmat,weights=ew)
  </code></pre>
  
  <p>and the error message:</p>
  
  <pre><code>Error in getPortfolio(er = er, cov.mat = covmat, weights = ew) : 
    unused arguments (er = er, cov.mat = covmat, weights = ew)
  </code></pre>