Learn R Programming

schoolmath (version 0.4.2)

is.negative: check whether numbers of a vector are negative

Description

check whether numbers of a vector are negative

Usage

is.negative(x)

Value

true or false

Arguments

x

the number or vector to check #'

Examples

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

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

Run the code above in your browser using DataLab