try_cast_integer {dRiftDM}R Documentation

Convert Character Digits to Numeric Digits

Description

This internal function casts a character vector to integer, if the character vector only contains digits for entries. If the input vector is not of type character or if any entry contains a non-digit, then the vector is returned unmodified.

Usage

try_cast_integer(values)

Arguments

values

a vector of values to attempt conversion to integer.

Value

an integer vector if conversion succeeds; otherwise, the original vector.


[Package dRiftDM version 0.2.2 Index]