R-beta: Three-dimensional arrays

Arne Kovac A.Kovac at Bristol.ac.uk
Wed Apr 2 15:27:40 CEST 1997


I get a segmentation fault when I access labelled three-dimensional
arrays:

> new.array<-array((1:27),c(3,3,3))
> new.array[,1,]
     [,1] [,2] [,3]
[1,]    1   10   19
[2,]    2   11   20
[3,]    3   12   21
> label<-c("l1","l2","l3")                                                 
> new.array<-array((1:27),c(3,3,3),list(label,label,label))
> new.array[,1,]
zsh: segmentation fault  R

The same happens when I try to fix the first component with

> new.array[1,,]
zsh: segmentation fault  R

The third component works:

> new.array[,,1]
   l1 l2 l3
l1  1  4  7
l2  2  5  8
l3  3  6  9

Arne

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



More information about the R-help mailing list