Skip to content
Prev 103063 / 398500 Next

Composition like classes & functions

Hello!

I am working on "breed composition" of animals in my project. Say I have
an animal 1 with parents 2 (father) and 3 (mother). If father is of
breed A and mother of breed B, then their descendant is of breed AB or
50 % of A and 50 % of B. I would like to have a general way to represent
 this kind of data. I was thinking about list structure i.e.

list(A=0.5, B=0.5)
$A
[1] 0.5

$B
[1] 0.5

Additionally, it should accommodate for more than 2 "classes".

However, I would like to ask if there is anything like this already in R
or contributed packages.

Thanks!