Re: [R] array() misfeature

From: Ben Bolker <bolker_at_ufl.edu>
Date: Sun, 2 Dec 2007 10:31:09 -0800 (PST)

Duncan Murdoch-2 wrote:
>
> On 02/12/2007 11:49 AM, Allen McIntosh wrote:

>> Version: 2.5.1

>
> That's an obsolete version, but the issue is still present in R-devel.
>
>> array() is inconsistent when given non-integral dimensions:
>> 
>>> zz <- array(0,dim=c(4,3.01))
>>> dim(zz)
>> [1] 4 3
>>> zz <- array(0,dim=c(201,4.05))
>> Error in dim(data) <- dim : dim<- : dims [product 804] do not match the
>> length of object [814]
>> 
>> 
>> [IMHO the code that did this is broken.  My copy of it has been
>> fixed.  Consistent behavior and/or a clearer error message would
>> just have made it easier to find the problem.]
>> 

>
> I'll add code to coerce dim to integer before using it. Thanks for the
> report.
>
> Duncan Murdoch
>
>

  While you're at it could you fix a trivial typo in ?dim ?

  in the description of the value argument: "... or a numeric vector which [is] coerced ..."
 (I would also say that either there should be a comma after
"vector" or "which" should be changed to "that", but never mind ...)

  Ben

-- 
View this message in context: http://www.nabble.com/array%28%29-misfeature-tf4932338.html#a14118356
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_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.
Received on Sun 02 Dec 2007 - 18:35:05 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 02 Dec 2007 - 20:30:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.