Learn R Programming

rapportools (version 1.1)

is.number: Numbers

Description

Checks if provided object is a number, i.e. a length-one numeric vector.

Usage

is.number(x, integer = FALSE)

Arguments

x

an object to check

integer

logical: check if number is integer

Value

a logical value indicating whether provided object is a string

Examples

Run this code
# NOT RUN {
is.number(3)              # [1] TRUE
is.number(3:4)            # [1] FALSE
is.number("3")            # [1] FALSE
is.number(NaN)            # [1] TRUE
is.number(NA_integer_)    # [1] TRUE
# }

Run the code above in your browser using DataLab