check_object_with_path: Check if an object name contains a valid environment path

Description Usage Arguments Details Value

View source: R/functions.r

Description

Check if a string may represent a valid object name with full environment path to the object as in globalenv()$env$x. The string should not end with ] or ) because that makes the whole expression an invalid name and therefore it should not be considered as a name (e.g. globalenv()$v[1] refers to element 1 of array v and such thing is not the name of an object).

Usage

1
check_object_with_path(x, checkenv = FALSE, envir = NULL)

Arguments

x

string to be checked.

checkenv

flag indicating whether the environment path should be checked for valid environment as well. Defaults to FALSE.

envir

environment where x should be evaluated when also checking the environment. Only used when checkenv=TRUE.

Details

Optionally a check of whether the path points to a valid environment inside a given environment is performed by calling .

Value

A list containing the following elements:

When checkenv=FALSE:

When checkenv=TRUE and when the string given in x is deemed to be a possible valid object, the following additional elements:


envnames documentation built on Dec. 8, 2020, 9:07 a.m.