ensureType: Returns the argument, but ensures that it has a certain...

View source: R/helpers.R

ensureTypeR Documentation

Returns the argument, but ensures that it has a certain class.

Description

If the x has not the given type it, the function prints information about the problem and stops with an error.

Usage

ensureType(x, type)

Arguments

x

the objects that shall be checked.

type

a string representing the type to be checked with 'is(x,type)'

Value

x

Examples

ensureType(3,"numeric")
ensureType(diag(2),"matrix")


DistributionalDDA documentation built on Oct. 20, 2026, 5:06 p.m.