is_real: is_real

View source: R/is_real.R

is_realR Documentation

is_real

Description

Is real

Usage

is_real(x, include_na = FALSE, verbose = TRUE)

Arguments

x

vector.

include_na

Logical if 'NA' should also be considered as non-real.

verbose

Logical if number of non-real numbers should be printed as message.

Details

The function checks if a vector contains real numbers and returns FALSE for NaN or Inf values. Input must be a vector. If include_na = TRUE also NA values are considered.

Value

vector

Examples

x <- c(1, 2, 3, NA, 5, NaN, Inf)
is_real(x)
is_real(x, include_na = TRUE)

y <- c(1, 2, 3, 4, 5, 6, 7)
is_real(y)


mhesselbarth/UtilityFunctions documentation built on Aug. 21, 2024, 8:18 a.m.