stop_invalid_math: Throw 'stype_invalid_math' Error

View source: R/utilities.R

stop_invalid_mathR Documentation

Throw 'stype_invalid_math' Error

Description

Helper function used to throw an error with a standardized class for the case where an unsupported math operation is called for a given stype type. This is intended to be explicitly invoked by internal routines in situations where we don't want the S3 dispatch to fall through to vctrs handling of math operators, which amounts to invoking the operator in base with the raw data as the input for types that are supported, and then restoring the appropriate vctrs but not stype type (for types that are not supported by vctrs an error is thrown immediately).

Usage

stop_invalid_math(x, op, class = NULL, ...)

Arguments

x

stype vector

op

the math operation

class

optional class argument passed to stype_abort

...

additional arguments passed to stype_abort


novisci/stype documentation built on July 28, 2022, 7:44 a.m.