This function applies the logistic function to a set of values.

logistic(x, na.rm = TRUE)

Arguments

x

A set of values (-Inf ≤ x ≤ Inf).

na.rm

Logical; if TRUE, removes NA values first.

Value

Returns a set of values between 0 and 1.

Examples

round(logistic(c(0, -2.197225, 2.1972255, -Inf, Inf)), 6)
#> [1] 0.5 0.1 0.9 0.0 1.0