On Apr 21, 2009, at 9:02 AM, onyourmark wrote:


Hi again. Thanks. I get it now.
So row(x) is a matrix with just the row number for each entry.

Yes.


How about x[row(x) == col(x)] ?
Can the square bracket function take a matrix as its argument? If so, I
guess I understand this statement.
The argument is a boolean matrix.

It can and it often does. The argument to the [] operation can be either a logical vector or a numeric vector which gets treated as an index. Try x[8]. My understanding is that the matrix, row(x) == col(x), as an argument would first get coerced to a vector constructed from the column-wise projection of the matrix. You can read further on the help page in the section that discusses matrices and arrays:

?"["


David Winsemius, MD
Heritage Laboratories
West Hartford, CT

______________________________________________
R-help@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.

Reply via email to