Closed thoree closed 4 years ago
Many thanks, I agree that these error messages are confusing. I have improved them, and included more input checks in a recent commit.
In case you are unaware, the reason for all of these errors is that x1
and x2
must be collected in a list. The following works as expected:
library(pedprobr)
#> Loading required package: pedtools
x1 = singleton(1)
x1 = setMarkers(x1, marker(x1, name = "m", alleles = 1:2))
x2 = nuclearPed(1, father = "FA")
x2 = setMarkers(x2, marker(x2, FA = 1, name = "m", alleles = 1:2))
# Together:
likelihood(list(x1, x2), marker = "m")
#> [1] 0.25
# Separate:
likelihood(x1, marker = "m") * likelihood(x2, marker = "m")
#> [1] 0.25
Created on 2020-07-09 by the reprex package (v0.3.0)
Fine - thanks! Thore
tor. 9. jul. 2020 kl. 21:48 skrev Magnus Dehli Vigeland < notifications@github.com>:
Many thanks, I agree that these error messages are confusing. I have improved them, and included more input checks in a recent commit.
In case you are unaware, the reason for all of these errors is that x1 and x2 must be collected in a list. The following works as expected:
library(pedprobr)#> Loading required package: pedtoolsx1 = singleton(1)x1 = setMarkers(x1, marker(x1, name = "m", alleles = 1:2)) x2 = nuclearPed(1, father = "FA")x2 = setMarkers(x2, marker(x2, FA = 1, name = "m", alleles = 1:2))
Together:
likelihood(list(x1, x2), marker = "m")#> [1] 0.25
Separate:
likelihood(x1, marker = "m") * likelihood(x2, marker = "m")#> [1] 0.25
Created on 2020-07-09 by the reprex package https://reprex.tidyverse.org (v0.3.0)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/magnusdv/pedprobr/issues/11#issuecomment-656317874, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSUNB6I6MDGKMYJ23O26OTR2YNJRANCNFSM4OVZ5IYA .
Here are some examples of
likelihood
behavour that appear strangeCreated on 2020-07-09 by the reprex package (v0.3.0)