magnusdv/pedtools

Plot one marker

thoree opened this issue · 2 comments

No big deal (there are other ways to do the below), but I seem to recall that the below used to work

library(pedtools)
x = nuclearPed()
m = marker(x,  "1" = 1)
plot(x, m)
#> Error in if (draw) {: the condition has length > 1

Created on 2023-02-28 with reprex v2.0.2

Yes, you have to use named arguments now, i.e., plot(x, marker = m).

This now gives a more informative error message:

library(pedtools)
x = nuclearPed()
m = marker(x,  "1" = 1)
plot(x, m)
#> Error: Illegal plot command.
#> 
#> Note: As of version 2.0.0, plot arguments must be named, e.g. `plot(x, marker = ...)` to include genotypes

Created on 2023-03-01 with reprex v2.0.2