Learn R Programming

pedometrics (version 0.6-2)

is.numint: Tests for data types

Description

Evaluate the data type contained in an object.

Usage

is.numint(x)

is.all.numint(x)

is.all.integer(x)

is.all.factor(x)

is.any.factor(x)

is.all.numeric(x)

is.one.type(x)

Arguments

x
Object to be tested.

Value

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

See Also

is.numeric, is.integer, is.factor.

Examples

Run this code
# Vector of integers
x <- 1:10
is.numint(x) # FALSE
# Vector of numeric integers
x <- as.numeric(x)
is.numint(x) # TRUE
# Vector of numeric values
x <- c(1.1, 1, 1, 1, 2) # FALSE
is.numint(x)
# Single numeric integer
is.numint(1) # TRUE
# Single numeric value
is.numint(1.1) # FALSE

Run the code above in your browser using DataLab