If I understand the sequence, you want the odd columns from the odd rows and the even columns from the even rows to "a" and the remainder go to "b". Once you have a transposed matrix, the recipe looks straightforward.

Clint

--
Clint Bowman                    INTERNET:       [email protected]
Air Quality Modeler             INTERNET:       [email protected]
Department of Ecology           VOICE:          (360) 407-6815
PO Box 47600                    FAX:            (360) 407-7534
Olympia, WA 98504-7600

On Thu, 25 Feb 2010, gianni lavaredo wrote:

dear Researcher

Sorry that I know this is not the right email-list and this is a basic help
but I am doing a remotesensing filter and I am honest, I have no idea how I
can do this.
I have a sequance form 1 to 16

> seq(1:16)
[1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16

and I wish to select this combination in a vector
a <- c(1,3,6,8,9,11,14,16)
b <- c(2,4,5,7,10,12,13,15)

following the below example

t(matrix(data = seq(1:16), nrow = 4, ncol = 4))
    [,1] [,2] [,3] [,4]
[1,]    1    2    3    4
[2,]    5    6    7    8
[3,]    9   10   11   12
[4,]   13   14   15   16

gianni

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


_______________________________________________
R-sig-Geo mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to