coerceMode {admisc}R Documentation

Coerce an atomic vector to numeric or integer, if possible

Description

This function verifies if an R vector is possibly numeric, and further if the numbers inside are whole numbers.

Usage

coerceMode(x)

Arguments

x

An atomic R vector

Value

An R vector of coerced mode.

Author(s)

Adrian Dusa

Examples

obj <- c("1.0", 2:5)

is.integer(coerceMode(obj))

[Package admisc version 0.35 Index]