[R] Storing Matrices into Hash

Gundala Viswanath gundalav at gmail.com
Fri Aug 1 03:53:36 CEST 2008


Hi,

Suppose I have these two matrices (could be more).
What I need to do is to store these matrices into a hash.

So that I can call back any of the matrix back later.

Is there a way to do it?

> mat_1
               [,1]        [,2]
  [1,] 9.327924e-01 0.067207616
  [2,] 9.869321e-01 0.013067929
  [3,] 9.892814e-01 0.010718579
  [4,] 9.931603e-01 0.006839735
  [5,] 9.149056e-01 0.085094444

> mat_2
               [,1]        [,2]
  [1,] 9.328202e-01 0.067179769
  [2,] 9.869402e-01 0.013059827
  [3,] 9.892886e-01 0.010711437
  [4,] 9.931660e-01 0.006833979
  [5,] 9.149391e-01 0.085060890


This method I have is not favorable
because it just stack the matrices together as another matrix.
Makes it hard to get individual matrix later.

all_mat <- NULL
all_mat <- c(all_mat, mat1,mat2)



- Gundala Viswanath
Jakarta - Indonesia



More information about the R-help mailing list