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 intuitive, this doesn't work. I've stumbled in the dark with mApply and 
other functions but can't
find anything in the help that works. This can't be that hard, but it has me 
stumped. 

Any help greatly appreciated,

Damian

______________________________________________
[email protected] 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