Bug in printing array of type "list"

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bug in printing array of type "list"

Hervé Pagès-2
Hi,

This array is of type "list" but print() reports otherwise:

   a1 <- array(list(1), 2:0)

   typeof(a1)
   # [1] "list"

   a1
   # <2 x 1 x 0 array of character>
   #      [,1]
   # [1,]
   # [2,]

No such problem with an array of type "logical":

   a2 <- array(NA, 2:0)

   typeof(a2)
   # [1] "logical"

   a2
   # <2 x 1 x 0 array of logical>
   #      [,1]
   # [1,]
   # [2,]

Thanks,
H.

--
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: [hidden email]
Phone:  (206) 667-5791
Fax:    (206) 667-1319

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel