[R] dynamic programming

Patrick Breheny patrick.breheny at uky.edu
Sun May 29 13:34:35 CEST 2011


On 05/29/2011 06:07 AM, garciap wrote:
> V<-fitness*(c+dive*pfood, t+1)

What are you trying to do in this line?  Multiply fitness by two 
different things at once?  The expression

(1,2)

Causes problems in R.  If you want to combine them into a vector, you need

c(1,2)

Otherwise, please go into greater detail about what you are trying to 
accomplish with this line of code.

Also, probably not a good idea to have a variable called 'c', as this is 
bound to lead to confusion with the function for combining objects, 'c()'.

-- 
Patrick Breheny
Assistant Professor
Department of Biostatistics
Department of Statistics
University of Kentucky



More information about the R-help mailing list