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 July 9, 2023, 5:54 p.m.

Related to coerceMode in admisc...