coerceMode: Coerce an atomic vector to numeric or integer, if possible

coerceModeR 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))

admisc documentation built on Sept. 12, 2024, 6:27 a.m.

Related to coerceMode in admisc...