Re: [R] Code to construct table with paired data

2017-04-08 Thread Mauricio Cardeal
Thank you Peter! Great solutions! That's exactly what I was looking for. MaurĂ­cio Cardeal Em 08/04/2017 09:11, peter dalgaard escreveu: > Here's one way: > >> ddw <- reshape(dd, direction="wide", idvar="pair", timevar="treatfac") >> names(ddw) > [1] "pair" "imprfac.A" "imprfac.B" >> xtabs(

Re: [R] Code to construct table with paired data

2017-04-08 Thread peter dalgaard
Here's one way: > ddw <- reshape(dd, direction="wide", idvar="pair", timevar="treatfac") > names(ddw) [1] "pair" "imprfac.A" "imprfac.B" > xtabs(~ imprfac.A + imprfac.B, ddw) imprfac.B imprfac.A + - + 1 3 - 2 1 (reshape() is a bit of a pain to wrap one's mind around;