if (FALSE) { # all(rlang::is_installed(c("RhpcBLASctl", "data.table")))
# \dontshow{
data.table::setDTthreads(2)
RhpcBLASctl::blas_set_num_threads(2)
RhpcBLASctl::omp_set_num_threads(2)
# }
example_gt <- load_example_gt("gen_tbl")
# For missingness
example_gt %>% loci_missingness()
# For missingness per locus per population
example_gt %>%
group_by(population) %>%
loci_missingness()
# alternatively, return a list of populations with their missingness
example_gt %>%
group_by(population) %>%
loci_missingness(type = "list")
# or a matrix with populations in columns and loci in rows
example_gt %>%
group_by(population) %>%
loci_missingness(type = "matrix")
# or within reframe (not recommended, as it much less efficient
# than using it directly as shown above)
example_gt %>%
group_by(population) %>%
reframe(missing = loci_missingness(genotypes))
}
Run the code above in your browser using DataLab