adonisText: Generates strings of text for the use in markdown documents

Description Usage Arguments Value Examples

View source: R/adonisText.R

Description

This function takes as input one object containing a test result and returns its most important informations. Function adonisText takes the result of a Permanova (returned from a call to the adonis function from the vegan package), returning its F (with corresponding model and residuals degrees of freedom) and P-values for a selected variable in the result. In addition, it offers options to customize the output, changing separators and decimal markers (helpful in case you are producing a manuscript in German or Portuguese), and choosing the number of digits to round number to.

Usage

1
adonisText(x, sep = "; ", dec = ".", digits = c(3, 3), which.coef = 1)

Arguments

x

Name of the object containing the result of the analysis from which stats should be extracted.

sep

How to separate pieces of information displayed. Defaults to a semicolon followed by a space (sep = "; ").

dec

Which decimal separator should be used? Defaults to ".". Allows to quickly changing to a comma in case you are producing a manuscript in German or Portuguese.

digits

How many digits should be kept for each piece of numeric information? Defaults to c(3, 3). Importantly, when a P-value rounded to the number of digits hereby defined results in zero, the result is replaced by a more theoretically meaningful alternative (e.g. P < 0.001).

which.coefs

Vector indexing which of the potential many variables should be accessed when type = "coefs".

Value

A string of text to be included in a markdown object.

Examples

1
2
3
4
5
6
library(vegan)
data(dune)
data(dune.env)
res <- adonis2(dune ~ Management*A1, data = dune.env)
adonisText(res, which.coef=1)
adonisText(res, which.coef=3, dec=",")

eduardohet/resulteR documentation built on Aug. 9, 2021, 3:02 a.m.