[R-SIG-Finance] PortfolioAnalytics: unused argument error

Brian G. Peterson brian at braverock.com
Tue Sep 20 17:32:45 CEST 2016


On Mon, 2016-09-19 at 23:08 +0000, Jason Hart wrote:
> I've never been able to get portfolioanalytics to work for me.  It
> looks like a nice little addition to the R arsenal but we just weren't
> meant to work together.  I figured what the heck I'll try this code
> and I got the same error message I usually get:

> Error in optimize.portfolio(R = returns, portfolio = pspec,
> optimize_method = "pso", : 
> unused arguments (R = returns, portfolio = pspec, optimize_method =
> "pso", trace = TRUE)
> 
> I've installed all the dependent (or at least I think I have) but to
> no avail.  I installed pso, all the different ROI packages, Rcmdr.
>  I've seen other people with the same issue but did not see a
> solution.

Really?  Which "other people"?  Link?  

My Google-fu only turned up one other instance of this error, and the
error was reportedly resolved by installing the dependencies.

> Any help is much appreciated.

Jason,

Please don't hijack the thread.  People who use threaded mail readers
will have difficulty following or finding your question.

Assuming you used the script from the prior thread, I had no problem
running that code on multiple machines and R versions.  

The error itself suggests that something is masking objects like
optimize.portfolio in your .GlobalEnv, but without more information
there's nothing to diagnose.

Please try to follow the posting guide:

https://www.r-project.org/posting-guide.html

At a minimum, please provide the output of 

sessionInfo()

Regards,

Brian



More information about the R-SIG-Finance mailing list