Learn R Programming

schoolmath (version 0.5.1)

is.real.positive: Check whether numbers are non-negative.

Description

A real positive number is defined here as a number greater than or equal to zero.

Usage

is.real.positive(x)

Value

A logical vector of the same length as `x`.

Arguments

x

A numeric vector.

Examples

Run this code
is.real.positive(-3) # FALSE
is.real.positive(0)  # TRUE

x <- c(0, -1, -2, 3.02, 4, -5.2, 6, -7)
is.real.positive(x)

Run the code above in your browser using DataLab