select_loci | R Documentation |
select
verb for loci
An equivalent to dplyr::select()
that works on the genotype
column
of a gen_tibble
, using the mini-grammar available for tidyselect
. The
select
-like evaluation only has access to the names of the loci (i.e. it
can select only based on names, not summary statistics of those loci; look
at select_loci_if()
for that feature.
select_loci(.data, .sel_arg)
.data |
a |
.sel_arg |
one unquoted expression, using the mini-grammar of
|
Note that the select_loci
verb does not modify the backing FBM files,
but rather it subsets the list of loci to be used stored in the gen_tibble
.
a gen_tibble
with a subset of the loci.
example_gt <- load_example_gt("gen_tbl")
# Select loci by name
example_gt_subset <- example_gt %>% select_loci(c("rs1", "rs2", "rs3"))
show_loci(example_gt_subset)
# Select loci by index
example_gt_subset <- example_gt %>% select_loci(c(4, 2, 1))
show_loci(example_gt_subset)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.