is.prob: is.prob

View source: R/is.prob.R

is.probR Documentation

is.prob

Description

Checks if x is in an opened/closed interval between min and max. The defaults are choosen such that the interval is an the interval (0,1), for example if x is a probability.

Usage

is.prob(x, open = TRUE, min = 0, max = 1)

Arguments

x

numeric: values to check

open

logical(1): are the left and right borders are open or closed (default: TRUE)

min

numeric: minimal value (default: 0)

max

numeric: maximal value (default: 1)

Value

a logical vector with the same length as x

Examples

is.prob(runif(1))

sigbertklinke/exams2moodle documentation built on July 6, 2023, 3:26 p.m.