Learn R Programming

Reacnorm: an R package to decompose the variance in reaction norms

What is this package?

Reacnorm provides various functions to partition the phenotypic variance of a plastic trait, studied through its reaction norm. The variance partition distinguishes between the variance arising from the average shape of the reaction norms (V_Plas) and the (additive) genetic variance . The latter is itself separated into an environment-blind component (V_G/V_A) and the component arising from plasticity (V_GxE/V_AxE). The package also provides a way to further partition V_Plas into aspects (slope/curvature) of the shape of the average reaction norm (π-decomposition) and partition V_Add (γ-decomposition) and V_AxE (ι-decomposition) into the impact of genetic variation in the reaction norm parameters.

This package is still in development and the article related to it is still in peer review has been recommended by PCI EvolBiol and is on its way to Peer Community Journal! It is being submitted to CRAN.

Reference

The current reference is the recommended preprint of de Villemereuil & Chevin (2025).

How to install this package

Using CRAN (not for now, coming soon)

  • Simply use install.packages("Reacnorm") as for any package.

From this GitHub

  • Install the remotes package: install.packages("remotes")
  • Install the packages on which Reacnorm depends: cubature, stringi and matrixStats. install.packages(c("cubature","stringi", "matrixStats", "R.rsp"))
  • Using the remotes package, install Reacnorm directly from this Github: remotes::install_github("devillemereuil/Reacnorm", build_vignette = TRUE)

Tutorial

You can access the tutorial of the package here, or by using vignette("TutoReacnorm") once the package is installed.

Submit feedback

If you encounter any bug or usability issue, or if you have some suggestions or feature request, please use the issue tracker. Thank you!

Copy Link

Version

Install

install.packages('Reacnorm')

Monthly Downloads

134

Version

0.2.1

License

GPL-3

Maintainer

Pierre de Villemereuil

Last Published

January 27th, 2025

Functions in Reacnorm (0.2.1)

rn_cs_gen

Decompose the \(\mathbf{G}\)-matrix from a character-state model
rn_vp_env

Compute the total phenotypic variance \(V_{\text{Tot}}\)
rn_gamma_env

Compute the \(\gamma\)-decomposition of additive genetic variance per environment
rn_mean_by_env

Compute the phenotypic mean on the observed scale
dragon_continuous

A simulated dataset on the reaction norms of dragons in a continuous environment
rn_pi_decomp

Compute the \(\pi\)-decomposition of \(V_{\text{Plas}}\)
rn_phi_decomp

Compute the \(\varphi\)-decomposition of \(V_{\text{Plas}}\)
rn_vgen

Compute the total genetic variance \(V_{\text{Gen}}\)
rn_gen_decomp

Compute the decomposition of the additive genetic variance and their \(\gamma\)- and \(\iota\)-decomposition
rn_vplas

Compute the purely environmental plastic variance \(V_{\text{Plas}}\)
rn_vtot

Compute the total phenotypic variance \(V_{\text{Tot}}\)
dragon_discrete

A simulated dataset on the reaction norms of dragons at a discretised environmental gradient