[R] filling part of a variable-sized array with another v-s array

Michael Roberts MROBERTS at ers.usda.gov
Fri Jul 12 01:49:52 CEST 2002


Hi

I have an array inside a function that might be anywhere from 3 to n 
dimensions.  Call this array X, and suppose its dimensions are
L, K, dim(Z), where Z is an array passed to the function and might
be of dimension 1 to n-2.

Within the function I would like to write a line something like

X[l,k, ] <- Z

however, this only works if Z is a vector.  I'd like it to work for a
Z of any dimension.

Is there an easy way to do this?

Thanks,

Michael J. Roberts

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list