biserialCorrelation: Biserial correlation analysis of presence and background data...

Description Usage Arguments Value Author(s) Examples

View source: R/biserialCorrelation.R

Description

Computes the biserial correlation between presence and background data for a set of predictors. A high biserial correlation for a given predictor indicates that the distributions of the presence and background records are separated enough in the space of predictor values to suggest that the predictor is a good candidate for a species distribution model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
biserialCorrelation(
  x,
  presence.column = "presence",
  variables = NULL,
  exclude.variables = NULL,
  axis.text.size = 6,
  legend.text.size = 12,
  strip.text.size = 10,
  point.size = 1,
  line.size = 1,
  plot = TRUE
)

Arguments

x

A data frame with a presence column with 1 indicating presence and 0 indicating background, and columns with predictor values.

presence.column

Character, name of the presence column.

variables

Character vector, names of the columns representing predictors. If NULL, all numeric variables but presence.column are considered.

exclude.variables

Character vector, variables to exclude from the analysis.

axis.text.size

Numeric, size of the axis labels.

legend.text.size

Numeric, size of the legend labels.

strip.text.size

Numeric, size of the panel names.

point.size

Size of points in the biserial correlation plot.

line.size

Line width in the biserial correlation plot.

plot

Boolean, prints biserial correlation plot if TRUE.

Value

A named list with two slots named plot and df. The former contains a ggplot object with the biserial correlation analysis. The latter is a data frame with the following columns:

variable: Name of the predictive variable. R2: R-squared of the biserial correlation. p: p-value of the correlation analysis. The output data frame is ordered, starting with the higher R2 values.

Author(s)

Blas Benito <blasbenito@gmail.com>

Examples

1
2
3
4
5
6
data(virtualSpeciesPB)
cPB <- biserialCorrelation(
  x = virtualSpeciesPB,
  presence.column = "presence",
  variables = c("bio1", "bio5", "bio6")
)

BlasBenito/SDMworkshop documentation built on March 4, 2020, 4:16 a.m.