Skip to contents

Preparation of data and details to create range-diversity plots.

Usage

prepare_PAM_CS(PAM, exclude_column = NULL, id_column = NULL,
               significance_test = FALSE, randomization_method = "picante",
               randomization_iterations = 100,
               CL = 0.05, picante_iterations = NULL,
               keep_randomizations = FALSE, parallel = FALSE,
               n_cores = NULL)

Arguments

PAM

matrix, data.frame, or base_PAM object containing information on presence and absence of species for a set of sites. Sites are organized in the rows and species in the columns. See details.

exclude_column

(optional) name or numeric index of columns to be excluded. Default = NULL.

id_column

(optional) name or numeric index of column containing the ID of sites (cells of the PAM). Default = NULL.

significance_test

(logical) whether to perform a test to detect sites (cells) that are statistically significant (i.e., the pattern detected can be distinguished from random expectations). Default = FALSE.

randomization_method

(character) method of randomization to be used. Options are: "picante" and "curve_ball". Default = "picante".

randomization_iterations

(numeric) number of iterations for the randomization test used to calculate statistical significance. Valid only with randomization_method = "picante." Default = 100.

CL

(numeric) confidence limit to detect statistically significant values. Default = 0.05.

picante_iterations

(numeric) number of iterations to be used for each matrix randomization process (to be done randomization_iterations times). This process is done using the function randomizeMatrix from the package picante. The default, NULL, uses 2 * sum(PAM).

keep_randomizations

(logical) whether to keep a matrix with all values from the randomization process. Default = FALSE.

parallel

(logical) whether to perform analyses in parallel. Default = FALSE.

n_cores

(numeric) number of cores to be used when parallel = TRUE. The default, NULL, uses available cores - 1.

Value

An S3 object of class PAM_CS if PAM is a matrix or data.frame, otherwise, an object of class base_PAM that contains the PAM_CS object as a part of PAM_indices.

Significant values are presented as a vector in which 0 means non-significant, and 1 and 2 represent significant values below and above confidence limits of random expectations, respectively.

Details

Range-diversity plot allow explorations of patterns of biodiversity in a region based on the data of presence-absence matrices. The plots to be produced using the information prepared here are a modification of those presented in Arita et al. (2011) doi:10.1111/j.1466-8238.2011.00662.x .

More details about the randomization_method can be found in the description of the functions used: from picante randomizeMatrix, and randomize_matrix_cb

Examples

# Data
b_pam <- read_PAM(system.file("extdata/b_pam.rds",
                              package = "biosurvey"))

# Preparing data for CS diagram
pcs <- prepare_PAM_CS(PAM = b_pam)

summary(pcs$PAM_indices$CS_diagram)
#> 
#>                      Summary of a PAM_CS object
#> ---------------------------------------------------------------------------
#> 
#> Descriptive values:
#>   Number of species:   25
#>   Number of cells:   228
#>   Whittaker's beta:   228
#>   Spearman's correlation:   228
#> 
#> Boundaries:
#>     x           y
#>  0.04 -0.01063509
#>  0.28  0.01913333
#>  0.28  0.04743860
#>  0.04  0.01767018
#> 
#> Summary normalized richness:
#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
#>   0.040   0.080   0.120   0.124   0.200   0.280 
#> 
#> Summary normalized dispersion field:
#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
#> 0.03509 0.29825 0.47149 0.43413 0.60088 0.78947