Open gregorgorjanc opened 2 months ago
The current behavior is to use rbind if the number of columns match and to empty out the slot if they don't. This is designed to account for the fact that there are no controls on the number of columns in the ebv slot.
I'm not currently looking at the names of the columns (they used to not have names). I should include these column names in the merge to make sure that they are consistent between populations.
I'm not so sure that it will be good idea to keep columns if they don't match across populations. It would be possible to add in NA for missing columns, but this might be a source of bugs in user scripts. For example, a lot of AlphaSimR is based on specifying numbered columns and the numbers for specific columns wouldn't necessarily be consistent if I were to run a merge like this.
In my view, I would throw an error if number of columns does not match across gv
, pheno
, and ebv
with a provision that ebv
could be empty (which is how pheno
is handled). In other words, I think it would make sense for behaviour around ebv
slot to match exactly what happens with the pheno
slot. Best to have consistency.
I agree that with column names it now becomes easier to handle this situation, but as long as the code is mostly/only working with column numbers and not column names, we can not rely on column names just now (some future majors update could) and hence have to have consistent column number AND column order and I would vote to fill in missing parts with NA.
Describe the bug
When we combine populations we loose EBVs if one of the population does not have them.
Steps To Reproduce
Here is a setup of an example:
First, let's look at genetic values:
OK, everyone has genetic value.
Now phenotypes, in the example these are present in one but not the other population:
OK,
NA
s as one might expect.Finally, EBVs:
Expected behavior
While working with NA's is a pain on it's own, I expected that
c(pop, pop2)@pheno
andc(pop, pop2)@ebv
would behave the same.Additional context
Happy to match behaviour of
c(pop, pop2)@ebv
toc(pop, pop2)@pheno
if we agree that this is indeed what we want;)