From ggrothendieck at gmail.com  Thu Oct 19 02:32:15 2006
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Wed, 18 Oct 2006 20:32:15 -0400
Subject: [Rd] Error: subscript out of bounds (PR#9305)
In-Reply-To: <20061018232910.64158AC01@slim.kubism.ku.dk>
References: <20061018232910.64158AC01@slim.kubism.ku.dk>
Message-ID: <971536df0610181732w439f714cv9d81fe584f88451f@mail.gmail.com>

See ?"[" and note in particular

"A third form of indexing is via a numeric matrix with the one column
for each dimension: each row of the index matrix then selects a single
element of the array, and the result is a vector."

Thus the result in this case should be a vector with element 1,3 as its first
component and element 2,4 as its second.  Of course since x is 2x2
neither of these exist.

Thus its behaving correctly.

On 10/18/06, salking at verizon.net <salking at verizon.net> wrote:
> Full_Name: Steven King
> Version: 1.16
> OS: OSX vesion 10.4.8
> Submission from: (NULL) (71.126.161.149)
>
>
>
> Setting a matrix is a function - the failure occurs only on 2 X 2 matrices.
>
> x<-matrix(1:4,nrow=2)
> > x
>     [,1] [,2]
> [1,]    1    3
> [2,]    2    4
> > x[x]<-2
> Error: subscript out of bounds
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>




[Rd] Error: subscript out of bounds (PR#9305)
Gabor Grothendieck