R already has ls(e), ls(e, all = TRUE), as.list(e) and str(as.list(e)) which will display the object names (except those that begin with dot), all object names, the entire contents of environment e and a summary of the contents so it is not clear what use this would be; however, we could add a name to an environment and then it will be displayed.
e <- new.env()
attr(e, "name") <- "my env"
e
## <environment: 0x000000001532f8b0>
## attr(,"name")
## [1] "my env"
or use environmentName
:
environmentName(e)
## [1] "my env"
In some cases the environment already has a name and/or other attributes.
baseenv()
## <environment: base>
globalenv()
## <environment: R_GlobalEnv>
as.environment("package:graphics")
## <environment: package:graphics>
## attr(,"name")
## [1] "package:graphics"
## attr(,"path")
## [1] "C:/Program Files/R/R-4.1/library/graphics"