thank you,
I have another problem,
my dataframe look like this,
the columns names x1,x2…x8 are gene’s names.
and 0,1,2, stands for genotypes.
and the column IID is for individuals names and they grouped in number 10004,
now I want to have avarage genotype for group 10004,
how can I do that?
Row │ Herd.when.genotyped IID x1 x2 x3 x4 x5 x6 x7 x8
│ Int64 Int64 Float64? Float64? Float64? Float64? Float64? Float64? Float64? Float64?
─────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ 10004 410240170 2.0 1.0 2.0 2.0 1.0 2.0 1.0 1.0
2 │ 10004 412396339 2.0 0.0 0.0 2.0 2.0 1.0 1.0 0.0
3 │ 10004 412442014 2.0 2.0 1.0 2.0 1.0 1.0 2.0 0.0
4 │ 10004 412409256 2.0 1.0 0.0 2.0 2.0 0.0 2.0 0.0
5 │ 10004 412419664 2.0 2.0 0.0 2.0 1.0 1.0 2.0 1.0
6 │ 10004 412442177 1.0 2.0 2.0 1.0 1.0 2.0 2.0 2.0
7 │ 10004 412556442 2.0 1.0 2.0 2.0 2.0 2.0 2.0 1.0
8 │ 10004 412502732 2.0 1.0 0.0 2.0 2.0 1.0 2.0 0.0
9 │ 10004 412490450 2.0 1.0 1.0 2.0 2.0 2.0 2.0 2.0
10 │ 10004 412788155 2.0 1.0 2.0 2.0 1.0 2.0 2.0 1.0