Hi:
How can I extract the dimension-names of a pre-defined element in a
multidimensional array in R ?

A toy example is provided below:
I have a 4-dimensional array with each dimension having certain length. In
the below example, "mydatastructure" explains the structure of my data.

mydatastructure = array(0, dim=c(length(b),length(z),length(x),length(d)),
dimnames=list(b,z,x,d))

where,
b=c("S1","S2","S3","S4","S5")
z=c("T1","T2", "T3")
x=c("U1","U2","U3","U4")
d=c("V1","V2")

Clearly, "mydatastructure" contains many 0's.
Now how can I get the dimension-names of any particular 0 ?
That is, my input should be a particular 0 in the array "mydatastructure"
(Suppose this 0 corresponds to S1,T3,U4 & V2 in the array). Then my output
should be S1,T3,U4 & V2.

The function "dimnames" didn't help me with the solution.
Any idea will greatly be appreciated.

Thanks for your time!

Kind Regards,
Sauvik

        [[alternative HTML version deleted]]

______________________________________________
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