Skip to content
Prev 317824 / 398506 Next

help with population matrix

It will be better if you can give us a complete example of what you want to
do. You start off with a typo in your for() command using "y" but then
switching to "t" in the code. You also say the rows "all have different
survival probabilities" but it is not clear where that fits into the picture
(b/2, s2?). Your provided code will fail when the loop reaches t=100 because
you will be referencing a column beyond the size of your matrix (i.e. pop[1,
101]).

Give us a reduced version of what you want to do, say 5 age categories (2
non-breeding, 3 breeding) and 5 years. It is likely that the looping can be
reduced and the number of lines of code reduced, but you've left out too
much for us to give you reasonable suggestions.

Give us complete code for this toy version of what you are trying to do and
it will be easier to see how to modify it for the bigger version.

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352