Beta-binomial software ??

Lyle Lofgren (lyle@rosevax.rosemount.com)
Tue, 13 Jan 1998 09:53:15 -0600


On Mon., 12 Jan 1998,
"Kirthi Kalyanam" <uunet!mailer.scu.edu!KKALYANAM>
wrote:

>Subject: Extracting Specific Rows of a matrix
>
>I want to create a matrix with the rows of x that have a zero in the first
>column.
>
> I tried ' if()' but this only used the first element of x.
>
>'Ifelse' does identify the rows that meet the condition but needs some value
>for the else part.
>
>Any suggestions of vectorized ways of doing this?
>
>Thanks
>
>Kirthi Kalyanam

If m is your matrix:

x <- seq(m[,1])[m[,1] == 0]

gives you a vector of all the rows for which the condition is true, and

m[x,]

will thus give you a matrix containing all the rows where the first column is
exactly zero.

Lyle Lofgren
Rosemount Inc.
Chanhassen MN