Hi

Is it possible to subset an n-dimensional array by a vector of n dimensions? 
E.g. assume I have

x <- array(1:24, dim=2:4)
x[1,1,2]
[1] 7
dims <- c(1,1,2)

I would like a function that I can supply x and dims as parameters to, and have 
it return 7. Also, I would like to do something like:

x[1,1,]
[1]  1  7 13 19
dims2<- c(1,1,NA)

And have a function of x and dims2 that gives me back [1]  1  7 13 19

Does such a thing exist?

Thanks

Richard


--
Richard D. Pearson             [EMAIL PROTECTED]
School of Computer Science,    http://www.cs.man.ac.uk/~pearsonr
University of Manchester,      Tel: +44 161 275 6178
Oxford Road,                   Mob: +44 7971 221181
Manchester M13 9PL, UK.        Fax: +44 161 275 6204

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to