Hi,

  I have a few graph objects created by some graphic package (say, ggplot2,
which I use frequently). Because of the existent relation between the
graphs, I'd like to index them in two dimensions as p[1,1], p[1,2], p[2,1],
p[2,2] for convenience.

  To my knowledge, the only data type capable of storing graph objects (and
any R object) is list, but unfortunately it is available in only one
dimension. Could the graphs be stored in any two-dimensional data type?

  One remedy that comes to my mind is to build a function f so that
f(1,1)=1
f(1,2)=2
f(2,1)=3
f(2,2)=4
  With functions f and f^{-1} (inverse function of f) , the two-dimensional
indices could be mapped to and from a set of one-dimensional indices, and
the functions are exactly the way R numbers elements in a matrix. Does R
have this built-in function for a m by n matrix or more generally, m*n*p
array? (I know this function is easy to write, but just want to make sure
whether it exists already)

   Thanks,

Miao

        [[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