Re: [Rd] is.matrix

2008-11-11 Thread William Dunlap
PROTECTED] On Behalf Of hadley wickham > Sent: Tuesday, November 11, 2008 12:03 PM > To: Wacek Kusnierczyk > Cc: r-devel@r-project.org > Subject: Re: [Rd] is.matrix > > On Tue, Nov 11, 2008 at 1:58 PM, Wacek Kusnierczyk > <[EMAIL PROTECTED]> wrote: > > hadley wickha

Re: [Rd] is.matrix

2008-11-11 Thread hadley wickham
On Tue, Nov 11, 2008 at 1:58 PM, Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote: > hadley wickham wrote: >> On Tue, Nov 11, 2008 at 1:42 PM, Wacek Kusnierczyk >> <[EMAIL PROTECTED]> wrote: >> >>> hadley wickham wrote: >>> > | is.matrix| returns |TRUE| if |x| is a matrix and has a |dim | > att

Re: [Rd] is.matrix

2008-11-11 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote: > hadley wickham wrote: > >>> | is.matrix| returns |TRUE| if |x| is a matrix and has a |dim | >>> attribute of length 2) and |FALSE| otherwise >>> >>> >> That's confusing! In what situations is x a matrix but does not have >> a dim attribute? >> >> >>

Re: [Rd] is.matrix

2008-11-11 Thread Wacek Kusnierczyk
hadley wickham wrote: > On Tue, Nov 11, 2008 at 1:42 PM, Wacek Kusnierczyk > <[EMAIL PROTECTED]> wrote: > >> hadley wickham wrote: >> | is.matrix| returns |TRUE| if |x| is a matrix and has a |dim | attribute of length 2) and |FALSE| otherwise >>> That's confusi

Re: [Rd] is.matrix

2008-11-11 Thread Wacek Kusnierczyk
Daniel Høyer Iversen wrote: >> That's confusing! In what situations is x a matrix but does not have >> a dim attribute? >> > > That was my point. I don't find it logical that > is.matrix(a) gives FALSE but > is.matrix(t( t(a) )) gives TRUE. > that's a different story, because t() performs

Re: [Rd] is.matrix

2008-11-11 Thread Christos Hatzis
ailto:[EMAIL PROTECTED] On Behalf Of Daniel > Høyer Iversen > Sent: Tuesday, November 11, 2008 2:36 PM > To: hadley wickham > Cc: Tony Plate; r-devel@r-project.org > Subject: Re: [Rd] is.matrix > > > That's confusing! In what situations is x a matrix but > does not h

Re: [Rd] is.matrix

2008-11-11 Thread hadley wickham
On Tue, Nov 11, 2008 at 1:42 PM, Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote: > hadley wickham wrote: >>> | is.matrix| returns |TRUE| if |x| is a matrix and has a |dim | >>> attribute of length 2) and |FALSE| otherwise >>> >> >> That's confusing! In what situations is x a matrix but does not have

Re: [Rd] is.matrix

2008-11-11 Thread hadley wickham
On Tue, Nov 11, 2008 at 1:35 PM, Daniel Høyer Iversen <[EMAIL PROTECTED]> wrote: >> That's confusing! In what situations is x a matrix but does not have >> a dim attribute? > > That was my point. I don't find it logical that > is.matrix(a) gives FALSE but > is.matrix(t( t(a) )) gives TRUE. > > I a

Re: [Rd] is.matrix

2008-11-11 Thread Wacek Kusnierczyk
hadley wickham wrote: >> | is.matrix| returns |TRUE| if |x| is a matrix and has a |dim | >> attribute of length 2) and |FALSE| otherwise >> > > That's confusing! In what situations is x a matrix but does not have > a dim attribute? > > x = matrix(1,1,1) dim(x) = c(1,1,1) is.matrix(x) # n

Re: [Rd] is.matrix

2008-11-11 Thread Daniel Høyer Iversen
> That's confusing! In what situations is x a matrix but does not have > a dim attribute? That was my point. I don't find it logical that is.matrix(a) gives FALSE but is.matrix(t( t(a) )) gives TRUE. I also think it would be more logical that a=c(1,1,2) dim(a) gives 3 1 instead of NULL, Danie

Re: [Rd] is.matrix

2008-11-11 Thread Peter Dalgaard
hadley wickham wrote: | is.matrix| returns |TRUE| if |x| is a matrix and has a |dim | attribute of length 2) and |FALSE| otherwise That's confusing! In what situations is x a matrix but does not have a dim attribute? Hadley Yes, I suspect a typo there. -- O__ Peter Dalgaard

Re: [Rd] is.matrix

2008-11-11 Thread hadley wickham
> | is.matrix| returns |TRUE| if |x| is a matrix and has a |dim | > attribute of length 2) and |FALSE| otherwise That's confusing! In what situations is x a matrix but does not have a dim attribute? Hadley -- http://had.co.nz/ __ R-devel@r-project.

Re: [Rd] is.matrix

2008-11-11 Thread Tony Plate
Daniel Høyer Iversen wrote: a=c(1,1,2); is.matrix(a) gives FALSE is.matrix(t(a)) gives TRUE is.matrix(t(t(a))) gives TRUE Is this correct? Shouldn't all give FALSE? I think is.matrix should give FALSE when dimension is 1*n or n*1. __ R-devel@r-project

Re: [Rd] is.matrix

2008-11-11 Thread Christos Hatzis
Dalgaard > Sent: Tuesday, November 11, 2008 1:31 PM > To: Daniel Høyer Iversen > Cc: r-devel@r-project.org > Subject: Re: [Rd] is.matrix > > Daniel Høyer Iversen wrote: > > a=c(1,1,2); > > is.matrix(a) gives FALSE > > is.matrix(t(a)) gives TRUE > > is.

Re: [Rd] is.matrix

2008-11-11 Thread Peter Dalgaard
Daniel Høyer Iversen wrote: > a=c(1,1,2); > is.matrix(a) gives FALSE > is.matrix(t(a)) gives TRUE > is.matrix(t(t(a))) gives TRUE > > Is this correct? Shouldn't all give FALSE? > I think is.matrix should give FALSE when dimension is 1*n or n*1. No this is correct. is.matrix() returns TRUE if and

[Rd] is.matrix

2008-11-11 Thread Daniel Høyer Iversen
a=c(1,1,2); is.matrix(a) gives FALSE is.matrix(t(a)) gives TRUE is.matrix(t(t(a))) gives TRUE Is this correct? Shouldn't all give FALSE? I think is.matrix should give FALSE when dimension is 1*n or n*1. __ R-devel@r-project.org mailing list https://stat