Learn R Programming

pedometrics (version 0.12.1)

isNumint: Tests for data types

Description

Evaluate the data type contained in an object.

Usage

isNumint(x)

allNumint(x)

anyNumint(x)

whichNumint(x)

allInteger(x)

anyInteger(x)

whichInteger(x)

allFactor(x)

anyFactor(x)

whichFactor(x)

allNumeric(x)

anyNumeric(x)

whichNumeric(x)

uniqueClass(x)

Arguments

x

Object to be tested.

Value

TRUE or FALSE depending on whether x contains a given data type.

See Also

base::is.numeric(), base::is.integer(), base::is.factor().

Examples

Run this code
# NOT RUN {
# Vector of integers
x <- 1:10
isNumint(x) # FALSE

# Vector of numeric integers
x <- as.numeric(x)
isNumint(x) # TRUE

# Vector of numeric values
x <- c(1.1, 1, 1, 1, 2)
isNumint(x) # FALSE
allNumint(x) # FALSE
anyNumint(x) # TRUE
whichNumint(x)

# Single numeric integer
isNumint(1) # TRUE

# Single numeric value
isNumint(1.1) # FALSE

# }

Run the code above in your browser using DataLab