Skip to contents

Converts the values of a relevé table from Original Braun-Blanquet simplified (OBBsim) values to Presence-absence scale with presences denoted as 1 (PA_1), and absences as 0.

Usage

OBBsim_to_PA_1(
  m,
  absence.values = c(".", "0"),
  parentheses.values = c("(+)", "(x)"),
  parentheses.replacement = 1
)

Arguments

m

matrix A relevé table.

absence.values

character A vector, with values representing absences in the OBBsim scale. Defaults to c(".", "0").

parentheses.values

vector A numericor character vector with the admissible values inside parentheses. Defaults to c("(+)", "(x)"). Traditionally "(+)" or "(x)" indicate the presence of a taxon that was out of the relevé area but that was observed in its close surroundings.

parentheses.replacement

integer The value to be used to replace values within parentheses. Defaults to 1.

Value

The matrix (m) with OBBsim values replaced by OTV_5.

Details

This function converts a relevé table using the OBBsim scale to a table using PA_1 scale (with absences denoted as 0). Note that "PA_1" scale is useful for numerical analysis but its use for storing tables in databases is not advisable, as this scale is not easily distinguishable from other commonly used scales. See releve_scale.

Author

Tiago Monteiro-Henriques. E-mail: tmh.dev@icloud.com.

Examples

m.ori <- matrix(c("5", "3", "r", "(x)", ".", "4", "2", "1", ".", "+"), 5, 2)
colnames(m.ori) <- c("rele1", "rele2")
rownames(m.ori) <- c("taxa1", "taxa2", "taxa3", "taxa4", "taxon5")
m.ord <- OBBsim_to_PA_1(m.ori)
m.ori
#>        rele1 rele2
#> taxa1  "5"   "4"  
#> taxa2  "3"   "2"  
#> taxa3  "r"   "1"  
#> taxa4  "(x)" "."  
#> taxon5 "."   "+"  
m.ord
#>        rele1 rele2
#> taxa1      1     1
#> taxa2      1     1
#> taxa3      1     1
#> taxa4      1     0
#> taxon5     0     1