magnusdv / pedtools

Tools for working with pedigrees in R
GNU General Public License v3.0
23 stars 3 forks source link

Plot one marker #41

Closed thoree closed 1 year ago

thoree commented 1 year ago

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

magnusdv commented 1 year ago

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

magnusdv commented 1 year ago

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