Learn R Programming

envnames (version 0.4.1)

standardize_env_name: Standardize the name of a named environment

Description

This function standardizes the name of a named environment so it is consistent with the output of the base function environmentName. For instance globalenv(), .GlobalEnv becomes "R_GlobalEnv" emptyenv() becomes "R_EmptyEnv" baseenv() or as.environment("package:base") becomes "base". All other named environments such as packages and namespaces are also converted to the standard name used by R.

Usage

standardize_env_name(env_name)

Arguments

env_name

environment name to standardize.

Value

Standardized name of the environment. If the environment is NOT a named environment and it does not contain an expression that resolves to a named environment it returns the input name as is. This includes strings that represent non-existing objects.