coerce_to_integer: Coerce an object to an integer, or error if that's not...

Description Usage Arguments Details Value

View source: R/utils.R

Description

R isn't the best language for strict typing, and it particularly struggles with integers. For example, is.integer(5) returns FALSE, because 5 is not the same as 5L. This function will attempt to convert a numeric or a character

Usage

1

Arguments

x

An integer-like value, or a character that represents an integer.

Details

A simpler (and potentially faster) implementation of this function would use the is_integerish function.

Value

an integer if possible, or an error if not


mdneuzerling/parity documentation built on Dec. 21, 2021, 4:51 p.m.