Re: [R] Take variables in data.frame and create list of matrices

2011-11-03 Thread AC Del Re
Thats a good start but I am looking for more. Specifically (from previous post): 4x4 matrix (based on the maximum number of factor levels in 'o') for each 'id' as a list. Each matrix would have v in the diagonal and r*s*s in the off-diagonal (e.g., .5*2.0814*.1095 = 0.1139), where r is constant (

Re: [R] Take variables in data.frame and create list of matrices

2011-11-03 Thread jose Bartolomei
I missed; using the Hadley Wickham plyr package >library (plyr)> dlply(dat, .(id)) $`1` id o r v s 1 1 1 0.5 -1.7131858 -2.0548666 2 1 2 0.5 0.6582979 0.9688939 3 1 3 0.5 -0.6861830 2.4213072 4 1 4 0.5 1.4134171 -0.4540244$`2` id o r v s 5 2 1

Re: [R] Take variables in data.frame and create list of matrices

2011-11-03 Thread jose Bartolomei
If i understood correctly this may help you > dlply(dat, .(id)) $`1` id o r v s 1 1 1 0.5 -1.7131858 -2.0548666 2 1 2 0.5 0.6582979 0.9688939 3 1 3 0.5 -0.6861830 2.4213072 4 1 4 0.5 1.4134171 -0.4540244$`2` id o r v s 5 2 1 0.5 0.2771839 1.06