Re: [R] map column name in matrix to multiple elements

2014-08-08 Thread Sarah Goslee
Using dput() to provide your data is enormously easier. Assuming the original column names of your data frame correspond to the ColMap column of the second data frame, it's very straightforward: mat <- structure(list(A = c(0.01, -2, -4), B = c(0.2, 1.4, -3), C = c(-0.3, 2.3, -2), D = c(0.8, 3.1,

[R] map column name in matrix to multiple elements

2014-08-08 Thread Adrian Johnson
Hi: I am requesting help on matrix mapping. I have a matrix that is 5000 rows x 3000 columns in R env. Matrix: A BC D E S1 0.01 0.2 -0.3 0.8-1 S2 -21.4 2.3 3.1-2 S3 -4 -3-2