Learn R Programming

enmpa (version 0.2.1)

niche_signal: Niche Signal detection using one or multiple variables

Description

Identifies whether a signal of niche can be detected using one or multiple variables. This is an implementation of the methods developed by Cobos & Peterson (2022) doi:10.17161/bi.v17i.15985 that focuses on identifying niche signals in presence-absence data.

Usage

niche_signal(data, condition, variables, method = "univariate",
             permanova_method = "mahalanobis", iterations = 1000,
             set_seed = 1, verbose = TRUE, ...)

niche_signal_univariate(data, condition, variable, iterations = 1000, set_seed = 1, verbose = TRUE)

niche_signal_permanova(data, condition, variables, permutations = 999, permanova_method = "mahalanobis", verbose = TRUE, ...)

Value

A list with results from analysis depending on method.

Arguments

data

matrix or data.frame containing at least the following information: a column representing condition (positive = 1 or negative = 0), and one or more columns representing environmental variables.

condition

(character) name of the column with numeric information about detection (positive = 1 or negative = 0).

variables

(character) vector of one or more names of columns to be used as environmental variables. If method = "univariate", only one variable is used; for method = "permanova", multiple variables can be used.

method

(character) name of the method to be used for niche comparison. Default = "univariate".

permanova_method

(character) name of the dissimilarity index to be used as method in adonis2. See all options in vegdist. Default = "mahalanobis".

iterations

(numeric) number of iterations to be used in analysis. Default = 1000. If method = "permanova", permutations = iterations - 1.

set_seed

(numeric) integer value to specify a initial seed. Default = 1.

verbose

(logical) whether or not to print messages about the process. Default = TRUE.

...

other arguments to be passed to adonis2.

variable

(character) name of the column containing data to be used as environmental variable.

permutations

number of permutations to be performed.

Examples

Run this code
# Load species occurrences and environmental data.
data("enm_data", package = "enmpa")
head(enm_data)

# Detection of niche signal using an univariate non-parametric test
sn_bio1 <- niche_signal(data = enm_data, variables = "bio_1",
                        condition = "Sp", method = "univariate")
sn_bio1

sn_bio12 <- niche_signal(data = enm_data, variables = "bio_12",
                         condition = "Sp", method = "univariate")
sn_bio12

Run the code above in your browser using DataLab