Re: [R] Population model question

From: Chris Stubben <stubben_at_lanl.gov>
Date: Tue, 15 Jan 2008 14:02:22 -0800 (PST)

-Halcyon- wrote:

> 
> My question is : How do I arbitrarily assign the animals being "FALSE"
> ***according to the uniformal chance generation*** to the array
> Dead.Animals, there being "TRUE"?
> 

Maybe I'm missing something, but aren't dead animals just the ones that aren't alive? Why do you even need the Dead.Animals array if you filled Live.Animals correctly?

## 4 animals in cohort and 3 years
Live.Animals<-matrix(c(T,T,F, T,T,T, T,T,F, F,F,F), nrow=4, byrow=TRUE)  Live.Animals

      [,1] [,2] [,3]
[1,] TRUE TRUE FALSE
[2,] TRUE TRUE TRUE
[3,] TRUE TRUE FALSE
[4,] FALSE FALSE FALSE

# Dead animals are NOT Live.Animals?

!Live.Animals

      [,1] [,2] [,3]
[1,] FALSE FALSE TRUE
[2,] FALSE FALSE FALSE
[3,] FALSE FALSE TRUE
[4,] TRUE TRUE TRUE
# or maybe use rowSums to find dead animals dead<- which(rowSums(Live.Animals) < 3)
[1] 1 3 4

Chris

-- 
View this message in context: http://www.nabble.com/Population-model-question-tp14833982p14848821.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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 Tue 15 Jan 2008 - 22:04:18 GMT

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 Tue 15 Jan 2008 - 22:30:07 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