Skip to content
Prev 55921 / 63424 Next

Bug in printing array of type "list"

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.