example_gt <- load_example_gt("gen_tbl")
# Select loci by name
example_gt_subset <- example_gt %>%
select_loci(all_of(c("rs1", "rs2", "rs3")))
show_loci(example_gt_subset)
# Select loci by index
example_gt_subset <- example_gt %>% select_loci(all_of(c(4, 2, 1)))
show_loci(example_gt_subset)
Run the code above in your browser using DataLab