search for: 2x2x11

Displaying 1 result from an estimated 1 matches for "2x2x11".

2006 Sep 25
1
Rows of a data frame to matrix
useRs, I have a data frame where four of the columns of the data frame represent the values of a two-by-two matrix. I'd like to, row-by-row, go through the data frame and use the four columns, in matrix form, to perform calculations necessary to create new values for variables in the data frame. My first idea was to use apply: apply(as.array(data.frame[,1:4]), 1, matrix, nrow=2) Though