Learn R Programming

schoolmath (version 0.5.1)

is.negative: Check whether numbers are negative.

Description

Check whether numbers are negative.

Usage

is.negative(x)

Value

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

Arguments

x

A numeric vector.

Examples

Run this code
is.negative(3)  # FALSE
is.negative(0)  # FALSE
is.negative(-2) # TRUE

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

Run the code above in your browser using DataLab