example_gt <- load_example_gt("gen_tbl")
# Detect pseudohaploids and set ploidy for the whole gen_tibble
example_gt <- example_gt %>% gt_pseudohaploid(test_n_loci = 3)
# Ploidy is now set to -2
show_ploidy(example_gt)
# Individual ploidy now varies between 1 (pseudohaploid) and 2 (diploid)
indiv_ploidy(example_gt)
Run the code above in your browser using DataLab