Often you need fast access/lookup in R. For instance assume that you have the following data frame/matrix dat >head(dat) x y z [1,] 1 1 1 0.46 -0.89 0.88 -0.21 0.46 0.93 1.06 [2,] 1 1 2 0.72 -0.40 1.71 -0.52 0.95 NA NA [3,] 1 1 3 -0.49 -0.42 -0.26 -0.06 1.07 1.48 1.08 [4,] 1 1 4 -1.55 -0.90 0.15 -0.60 1.86 -1.15 NA [5,] 1 1 5 -0.46 -1.54 -0.40 NA NA NA NA [6,] 1 1 6 0.14 1.13 -2.42 0.86 0.13 -1.60 0.62 x, y and z represent an unique index and the rest of the columns represent a vector. The vectors may be of various length. To find the vector corresponding to index (x,y,z) you can do a normal search:
Daily Archives: February 1, 2009
1 post