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

From: Martin Maechler <maechler_at_stat.math.ethz.ch>
Date: Wed, 03 Jun 2009 11:36:52 +0200

>>>>> "vQ" == Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk_at_idi.ntnu.no> >>>>> on Wed, 03 Jun 2009 10:43:25 +0200 writes:

    vQ> 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.

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

    vQ> [,1]      [,2]    
    vQ> [1,]        NA        NA

thank you, Waclav.

I don't see any unnecessary space (or other CPU problems), using another Linux variant (RHEL 5)
in the three R version

       	  2.9.0 ,  
	  2.9.0-patched (r48700)
	  2.10.0-devel  (r48700)

Can other Windows (or ...) users confirm problems in R 2.9.0 (or newer) ?

Regards,
Martin Maechler

>> 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!
>>
    vQ> user  system elapsed
    vQ> 0.648   0.056 155.843
    vQ> [,1] [,2]
    vQ> [1,]  NA   NA
    vQ> user  system elapsed
    vQ> 0.648   0.056 155.843

    vQ> vQ

    vQ> ______________________________________________
    vQ> R-devel_at_r-project.org mailing list     vQ> https://stat.ethz.ch/mailman/listinfo/r-devel

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 03 Jun 2009 - 09:45:49 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 Wed 03 Jun 2009 - 19:34:35 GMT.

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

list of date sections of archive