safe_get_type: Safely get a variable of specific type.

View source: R/utils.R

safe_get_typeR Documentation

Safely get a variable of specific type.

Description

Safely get a variable of specific type.

Usage

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

Arguments

x

Quoted name of the variable.

type

The data type 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.