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

Martin Maechler maechler at stat.math.ethz.ch
Wed Jun 3 11:36:52 CEST 2009


>>>>> "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



More information about the R-devel mailing list