For some reason, a code I usually run in Rstudios is no longer working. I'm hoping that someone has had a similar experience and understands what's going on.
getReturns(c('C','BAC'), start='2004-01-01', end='2008-12-31')
This results in:
Error in unclass(e1) + unclass(e2) :
non-numeric argument to binary operator
I can't find anything online nor on stackoverflow that addresses this issue. Also, I saw that the most recent documentation, from July 2014 doesn't mention anything either:
http://cran.r-project.org/web/packages/stockPortfolio/stockPortfolio.pdf
Does anyone have any idea what's going on here?
It's probably a function name clash issue. Running
gives me the error, but running
works fine.
How did this happen?
You must have loaded the
stockPortfolio
package, and then loaded eithertimeSeries
or another package that depends upontimeSeries
. Have a look through your console for a message that looks likeUse the double colon operator (as shown above) to explicitly tell R which package to look in.