From Waclaw.Marcin.Kusnierczyk at idi.ntnu.no  Tue Nov 11 20:59:49 2008
From: Waclaw.Marcin.Kusnierczyk at idi.ntnu.no (Wacek Kusnierczyk)
Date: Tue, 11 Nov 2008 20:59:49 +0100
Subject: [Rd] is.matrix
In-Reply-To: <4919E010.8080603@idi.ntnu.no>
References: <d8858f220811111020j233d4d98j502c0079ace644e7@mail.gmail.com>	<4919D240.4040904@acm.org>	<f8e6ff050811111121u62cc1329s605ca0dcd521dfb2@mail.gmail.com>
	<4919E010.8080603@idi.ntnu.no>
Message-ID: <4919E435.90801@idi.ntnu.no>

Wacek Kusnierczyk wrote:
> hadley wickham wrote:
>   
>>> |  is.matrix| returns |TRUE| if |x| is a matrix and has a |dim <dim.html>|
>>> 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)
> # no
> is("matrix", x)
> # no
> is(x)
> # hm...
>
> following the last, there would be a situation in which an object is a
> matrix (per is(...)) and has a dim attribute of length != 2, but is a
>   
but is *not*

> matrix (per is.matrix(...) and is("matrix", ...), consistently with the
> docs).
>
> (the redundant "vector" in is(x) could probably be removed?)
>
> vQ
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] is.matrix
Wacek Kusnierczyk