safe_get_num: Safely get a double or an integer

View source: R/utils.R

safe_get_numR Documentation

Safely get a double or an integer

Description

Safely get a double or an integer

Usage

safe_get_num(x, env = parent.frame(), inherits = FALSE, add = TRUE)

Arguments

x

Quoted name of the variable.

env

The environment in which to search.

inherits

Whether to search in the parent environments.

add

Whether or not to add feedback.

Details

First checks whether the variable exists in the environment. If it does, then checks whether it is of the appropriate type.

Value

A value of the desired type if found, or NULL if not found.


dalejbarr/assessr documentation built on Jan. 25, 2024, 10:47 p.m.