Grokbase Groups R r-help October 2003
FAQ
Hi!

I have a 3d array:
dim(ib5km15.dbc)
[1] 190 241 19

and a set of positions to extract:
ib5km.lincol.random[1:3,]
[,1] [,2]
[1,] 78 70
[2,] 29 213
[3,] 180 22

Geting the values of a 2D array
for that set of positions would
be:
ima <- ib5km15.dbc[,,1]
ima[ib5km.lincol.random[1:10,]]
but don't find the way for the case
of the 3D array:
ib5km15.dbc[ib5km.lincol.random[1:10,],]
Error in ib5km15.dbc[ib5km.lincol.random[1:10, ], ] :
incorrect number of dimensions

Could anyone suggest the way of subseting
the 3D array to get a vector of z values
for each position recorded in ib5km.lincol.random?
(avoiding the use of for loops).

Thanks

Agus

Dr. Agustin Lobo
Instituto de Ciencias de la Tierra (CSIC)
Lluis Sole Sabaris s/n
08028 Barcelona SPAIN
tel 34 93409 5410
fax 34 93411 0012
alobo at ija.csic.es

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 4 | next ›
Discussion Overview
groupr-help @
categoriesr
postedOct 15, '03 at 4:47p
activeOct 15, '03 at 5:42p
posts4
users4
websiter-project.org
irc#r

People

Translate

site design / logo © 2017 Grokbase