R-alpha: bug in array subsetting

Larry P Ammann (ammann@utdallas.edu)
Wed, 12 Feb 1997 23:20:21 -0600 (CST)


Date: Wed, 12 Feb 1997 23:20:21 -0600 (CST)
From: Larry P Ammann <ammann@utdallas.edu>
Message-Id: <199702130520.XAA12618@utdallas.edu>
To: r-testers@stat.math.ethz.ch
Subject: R-alpha: bug in array subsetting

Here's an interesting bug in R.15 and R.16.1:

laplace% R

R : Copyright 1997, Robert Gentleman and Ross Ihaka
Version 0.16.1  (Released: February 11, 1997)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type "license()" for details.

> x <- array(1:12,c(2,2,3))
> x
, , 1

     [,1] [,2]
[1,]    1    3
[2,]    2    4

, , 2

     [,1] [,2]
[1,]    5    7
[2,]    6    8

, , 3

     [,1] [,2]
[1,]    9   11
[2,]   10   12

> x[,2,]
     [,1] [,2] [,3]
[1,]    3    7   11
[2,]    4    8   12
> dimnames(x) <- list(c("A","B"),c("C","D"),1:3)
> x
, , 1

  C D
A 1 3
B 2 4

, , 2

  C D
A 5 7
B 6 8

, , 3

   C  D
A  9 11
B 10 12

> x[,2,]
Segmentation fault (core dumped)


Larry Ammann
Professor of Mathematical Sciences
University of Texas at Dallas
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- For info or help, send "info" or "help",
To [un]subscribe, send "[un]subscribe"
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-