try_cast_integer: Convert Character Digits to Numeric Digits

View source: R/extended_s3_methods.R

try_cast_integerR 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.


dRiftDM documentation built on April 3, 2025, 7:48 p.m.