Skip to content
Prev 165403 / 398506 Next

How can I avoid nested 'for' loops or quicken the process?

On Dec 23, 2008, at 9:55 AM, Brigid Mooney wrote:

            
apply is giving calcProfit a named numeric vector and then calcProfit  
is trying to parse it with "$" which is an operator for lists. Try  
serial corrects of the form:

long <- IterParam["long"]

That seemed to let the interpreter move on to the next error ;-)

 > Results2 <- apply(CombParam, 1, calcProfit, X, Y)
Error in IterParam$short : $ operator is invalid for atomic vectors