Re: [R] dynamic programming

From: Patrick Breheny <patrick.breheny_at_uky.edu>
Date: Sun, 29 May 2011 07:34:35 -0400

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

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Sun 29 May 2011 - 11:36:25 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 29 May 2011 - 12:00:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive