tidypopgen: Tidy Population Genetics

We provide a tidy grammar of population genetics, facilitating the manipulation and analysis of data on biallelic single nucleotide polymorphisms (SNPs). 'tidypopgen' scales to very large genetic datasets by storing genotypes on disk, and performing operations on them in chunks, without ever loading all data in memory. The full functionalities of the package are described in Carter et al. (2025) <doi:10.1111/2041-210x.70204>.

Version: 1.1.0
Depends: R (≥ 3.5.0), dplyr (≥ 1.2.0), tibble
Imports: bigparallelr, bigsnpr, bigstatsr, data.table, foreach, generics, lifecycle (≥ 1.0.2), ggplot2 (≥ 3.5.0), methods, MASS, patchwork, runner, rlang, RSpectra, sf, stats, tidyselect, tidyr, utils, Rcpp, vctrs, gtable
LinkingTo: Rcpp, RcppEigen, bigstatsr, rmio
Suggests: adegenet, admixtools, ape, broom, hexbin, hierfstat, knitr, detectRUNS, LEA, pcadapt, RhpcBLASctl, rmarkdown, rnaturalearth, rnaturalearthdata, readr, reticulate, testthat (≥ 3.1.7), vcfR, withr, xgboost, spelling
Published: 2026-11-27
DOI: 10.32614/CRAN.package.tidypopgen
Author: Evie Carter [aut], Eirlys Tysall [aut], Andrea Manica ORCID iD [aut, cre, cph], Max Carter-Brown [ctb], Jason Hodgson [ctb], Christopher Chang [ctb, cph] (Author of PLINK 1.90: Hardy-Weinberg exact test code used in loci_hwe() and qc_report_loci(); runs of homozygosity algorithm followed by windows_indiv_roh(); LD pruning algorithm followed by loci_ld_prune()), Shaun Purcell [ctb, cph] (Author of PLINK 1.90: Hardy-Weinberg exact test code used in loci_hwe() and qc_report_loci(); runs of homozygosity algorithm followed by windows_indiv_roh(); LD pruning algorithm followed by loci_ld_prune()), Henrik Bengtsson [ctb, cph] (Author of countLines() in R.utils, modified for .vcf in count_vcf_variants()), Jan Wigginton [ctb, cph] (Author of the original Hardy-Weinberg exact test code (SNPHWE), on which the PLINK 1.90 code used in loci_hwe() is based), Florian Privé [ctb, cph] (Author of bigsnpr and bigstatsr, code from which is adapted in read_packedancestry_to_fbm(), gt_as_plink(), predict.gt_pca(), autoplot.gt_dapc() and loci_ld_clump()), Jérôme Goudet [ctb, cph] (Author of hierfstat, code from which is adapted in pop_global_stats(), pop_het_obs(), pop_het_exp() and indiv_inbreeding()), Robert Maier [ctb, cph] (Author of admixtools, code from which is adapted in gt_extract_f2()), Ryan Gutenkunst [ctb, cph] (Author of dadi, whose Spectrum class is translated to R in the tests of the site frequency spectra), Isaac Overcast [ctb, cph] (Author of easySFS, translated to R in the tests of the site frequency spectra)
Maintainer: Andrea Manica <am315 at cam.ac.uk>
BugReports: https://github.com/EvolEcolGroup/tidypopgen/issues
License: GPL (≥ 3)
Copyright: see file COPYRIGHTS
URL: https://github.com/EvolEcolGroup/tidypopgen, https://evolecolgroup.github.io/tidypopgen/
NeedsCompilation: yes
Additional_repositories: https://evolecolgroup.r-universe.dev/
Language: en-GB
Citation: tidypopgen citation info
Materials: README, NEWS
CRAN checks: tidypopgen results

Documentation:

Reference manual: tidypopgen.html , tidypopgen.pdf
Vignettes: The grammar of population genetics (source, R code)
Quality Control (source, R code)
Population genetic analysis (source, R code)
PLINK cheatsheet (source, R code)
tidypopgen (source, R code)

Downloads:

Package source: tidypopgen_1.1.0.tar.gz
Windows binaries: r-devel: tidypopgen_1.0.0.zip, r-release: tidypopgen_1.0.0.zip, r-oldrel: tidypopgen_1.1.0.zip
macOS binaries: r-release (arm64): tidypopgen_1.1.0.tgz, r-oldrel (arm64): tidypopgen_1.1.0.tgz, r-release (x86_64): tidypopgen_1.1.0.tgz, r-oldrel (x86_64): tidypopgen_1.1.0.tgz
Old sources: tidypopgen archive

Reverse dependencies:

Reverse suggests: dartR.base

Linking:

Please use the canonical form https://CRAN.R-project.org/package=tidypopgen to link to this page.