[Rd] Print bug for matrix(list(NA_complex_, ...))

Wacek Kusnierczyk Waclaw.Marcin.Kusnierczyk at idi.ntnu.no
Wed Jun 3 10:43:25 CEST 2009


Stavros Macrakis wrote:
> In R 2.8.0 on Windows (tested both under ESS and under R Console in case
> there was an I/O issue)
>
> There is a bug in printing val <- matrix(list(NA_complex_,NA_complex_),1).
>
>   
>> dput(val)
>>     
> structure(list(NA_complex_, NA_complex_), .Dim = 1:2)
>
>   
>> print(val)
>>     
>
> [,1]
>
> [1,]
>
>
> [,2]
>
> [1,]
>
>
> Note that a large number of spaces are printed instead of NA.  

on ubuntu 8.04 with r 2.10.0 r48703 there is almost no problem (still
some unnecessary spaces):

     [,1]      [,2]    
[1,]        NA        NA



> Compare the
> unproblematic real case:
>
> print(structure(list(NA_real_, NA_real_), .Dim = 1:2))
>      [,1] [,2]
> [1,] NA   NA
>
> Also, when printed in the read-eval-print loop, printing takes a very very
> long time:
>
>   
>> proc.time(); matrix(list(NA_complex_,NA_complex_),1); proc.time()
>>     
>    user  system elapsed
>   74.35    0.09  329.45
>
> [,1]
>
> [1,]
>
>
> [,2]
>
> [1,]
>
>    user  system elapsed
>   92.63    0.15  347.86
>
> 18 seconds runtime!
>   

   user  system elapsed
  0.648   0.056 155.843
     [,1] [,2]
[1,]  NA   NA
   user  system elapsed
  0.648   0.056 155.843

vQ



More information about the R-devel mailing list