(Non)Additive Genetic Relatedness Matrices
Overview
Constructs (non)additive genetic relationship matrices, and their inverses, from a pedigree to be used in linear mixed effect models (A.K.A. the 'animal model'). Also includes other functions to facilitate the use of animal models. Some functions have been created to be used in conjunction with the R package 'asreml' for the 'ASReml' software, which can be obtained upon purchase from 'VSN' international (https://vsni.co.uk/software/asreml).
NEW
makeDiiF()can now be given coefficients of inbreeding. Facilitates either:- calculating
fin a new generation of the pedigree iffhas already been calculated for previous generations - creating a "phantom parent" to all founders to specify an average coefficient of inbreeding in the base population.
- can be used to speed up simulations where breeding values are calculated based on mid-parent value plus Mendelian sampling deviation (that needs to account for inbreeding of parents).
Major changes
proLik()(andproLik4()) __REMOVED__ from the package.- these functions were _only_ to facilitate advanced use of the
asremlR package (which requires purchasing an expensive license) and due to the __unstable__ behavior ofasremldiscovered when revisingproLik()it was decided thatnadivshould no longer support this other package in this way. - Instead, time will be spent improving the
gremlinR package for a replacement toasreml. makeA()was affected by a bug inMatrix<1.6-0Matrix::chol2inv()bug highlighted a messy order of operations innadiv- now perfected the order of operations and explicitly use
tcrossprod()and
Show all changes in 2.18.0Hide the rest of the changes in 2.18.0
solve() which are just what chol2inv() uses
- done to be more explicit in
nadivand take 1 step away from future bugs like this - checked speed and memory profiling for several options of types of matrices
- dtCMatrix is best for time (tried "dtrMatrix" and "dtpMatrix", but these
were __much__ slower.
chol2inv()andtcrossprod(solve())allocated same amount of memory according toprofmempackage- bug in
makeAinv(),makeGGAinv(), andmakeDiiF()caused coefficients of inbreeding (f) and Mendelian sampling variances (dii) to be ordered incorrectly - this did _not_ cause matrices from these functions to be incorrect (e.g., __Ainv__, __Tinv__, and their related matrices), but did cause matrices built directly from
diito be incorrect - namely the __A__ matrix frommakeA()and so consequently anything built from __A__ (i.e., dominance and epistatic relatedness matrices throughmakeD()etc.) - __this was FIXED__ with details in the commit
Small changes
nadivversion 2.17.2 caused CRAN to archive due to error induced byMatrixupdates- Mikael Jagan (
Matrixauthor) helpfully provided excellent explanations and patches - errors in
nadivcode caused by new methods forall.equal()andrbind2() - removed methods
is.numPed()andis.proLik() - hardly use first and never second plus they just call
inherits()
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK12 OK2026-04-25
- NOTE11 OK, 3 NOTE2026-03-10
Documentation
- Help pages
- 45 (2 internal)includes a package overview page
- Examples that run
- 89%34 run in a plain check · 2 only when donttest examples are enabled (R CMD check --as-cran) · 2 never run
- Exported functions with examples
- 85%
- Documented parameters
- 93%
- Return-value docs
- 97%
- Help pages citing references
- 33%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 3
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
1 development-tooling and community-health practice detected across 1 family in the upstream repository
Checks run against github.com/matthewwolak/nadiv on 2026-10-21.
Dependencies
Installing nadiv adds no packages beyond those that come with R.
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- unarchivedReturned to CRAN2024-05-23
- 2.18.0Latest2024-05-23 · current release · diff ↗ ·
removed 4 exports
is.numPed, parConstrainFun, proLik, proLik4 - RR 4.4.0 released · 2024-04-24
- archivedRemoved from CRAN2023-12-06issues were not corrected in time
- RR 4.3.0 released · 2023-04-21
- 2.17.2
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- 2.17.12021-04-06 · diff ↗
- 2.17.0
- RR 4.0.0 released · 2020-04-24
- 2.16.2.0
- RR 3.6.0 released · 2019-04-26
- 2.16.0.02018-05-10 · diff ↗ ·
removed 4 exports
is.proLik, plot.proLik, makeAinv.default, makeAinv.fuzzyadded 3 exports
makeSd, makeSdsim, pin
Show 24 earlier eventsHide 24 earlier events
- RR 3.5.0 released · 2018-04-23
- RR 3.4.0 released · 2017-04-21
- RR 3.3.0 released · 2016-05-03
- RR 3.2.0 released · 2015-04-16
- RR 3.1.0 released · 2014-04-10
- RR 3.0.0 released · 2013-04-03
- 2.15.22012-07-16 · diff ↗ ·
removed 8 exports
IBD, IBD2, vchoose, chooser, SEfun, DFC, findBetween, wrap_dijadded 6 exports
aic, drfx, grfx, makeS, simPedDFC, simPedHS - RR 2.15.0 released · 2012-03-30
- 2.15.02012-03-22 · diff ↗ ·
added 10 exports
IBD, IBD2, vchoose, chooser, SEfun, constrainFun, parConstrainFun, wrap_dij, aiCI, varTrans - 2.14.3.12016-09-22 · diff ↗
- 2.14.3
- 2.14.22016-02-05 · diff ↗
- 2.14.12015-07-22 · diff ↗
- 2.14.0
- 2.13.3
- 2.13.22014-06-20 · diff ↗
- 2.13
- 2.12
- 2.112013-02-26 · diff ↗
- 2.10
- 2.92012-03-28 · diff ↗
- 2.82012-02-07 · diff ↗ ·
removed 1 export
FindDFCadded 4 exports
findDFC, proLik, plot.proLik, findBetween - 2.72011-12-18
- RR 2.14.0 released · 2011-10-31
Package metadata
- First published
- 2011-12-18
- Total releases
- 22 / 15 yrs
- License
- GPL (>= 2) OSI
- Minimum R
- ≥ 4.2.0
- Bundled data
- 624 KB / 9 files
- Download size
- 719 KB
Cite
Cite this package
Run in R for the authors' entry:
citation("nadiv")The package provides a citation file, so citation() returns the authors' own entry.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.