Re: [R] To preserve the class "Matrix"

2008-05-06 Thread David Winsemius
"Shubha Vishwanath Karanth" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Thank you very much Mark! That worked Just a question, ?[ does > give an error to me...how do I find it? Try: ?"[" __ R-help@r-project.org mailing list https://sta

Re: [R] To preserve the class "Matrix"

2008-05-06 Thread Shubha Vishwanath Karanth
- From: Shubha Vishwanath Karanth Sent: Tuesday, May 06, 2008 8:50 PM To: 'Mark Leeds' Subject: RE: [R] To preserve the class "Matrix" Thank you very much Mark! That worked Just a question, ?[ does give an error to me...how do I find it? Shubha Karanth | Amba Research

[R] To preserve the class "Matrix"

2008-05-06 Thread Shubha Vishwanath Karanth
Hi, Suppose a=matrix(1:9,3,3) > a [,1] [,2] [,3] [1,]147 [2,]258 [3,]369 Now, > class(a[1:2,]) [1] "matrix" > class(a[1:3,]) [1] "matrix" > class(a[,1:2]) [1] "matrix" > class(a[,1:3]) [1] "matrix" But, > class(a[1,]) [1] "i