custnorm: Normal function defined by extremes

View source: R/sp.env.functions.R

custnormR Documentation

Normal function defined by extremes

Description

A modified version of the normal function based on three parameters:

  • the mean

  • the absolute difference between the mean and extreme values

  • the percentage of area under the curve between the specified extreme values

See the example for an easier understanding.

Usage

custnorm(x, mean, diff, prob)

Arguments

x

a numeric value or vector. The input environmental variable.

mean

a numeric value or vector. The optimum (mean) of the normal curve

diff

a numeric value or vector. The absolute difference between the mean and extremes.

prob

a numeric value or vector. The percentage of the area under the curve between the chosen extreme values

Value

a numeric value or vector resulting from the function

Author(s)

Boris Leroy leroy.boris@gmail.com, Florian David

Maintainer: Boris Leroy leroy.boris@gmail.com

Examples

# Let's define the response of a species to temperature which
#  - has an optimum at 20 degrees C
#  - occurs 99% of the time between 13 and 27 degrees C.
# In that case, mean = 20, diff = 7, and prob = 0.99

# First, we generate an arbitrary temperature variable 
# between 0 and 30 degrees C
temp <- seq(0, 30, length = 1000)


# Then, we calculate the response to this variable with the chosen values
response <- custnorm(x = temp, mean = 20, diff = 7, prob = .99)

plot(response ~ temp, type = "l")

virtualspecies documentation built on Sept. 27, 2023, 1:06 a.m.