Running examples in 'envnames-Ex.R' failed
The error most likely occurred in:

> ### Name: envnames-package
> ### Title: Track user-defined environment names
> ### Aliases: envnames-package envnames
> ### Keywords: package environment
> 
> ### ** Examples
> 
> library(envnames)
> rm(list=ls())
> 
> ### Example 1: Retrieve the names of user-defined environments (created with new.env())
> # Create new environments
> env1 <- new.env()                      # Environment in .GlobalEnv
> env2 <- new.env()                      # Environment in .GlobalEnv
> env3 <- new.env(parent=baseenv())      # Environment whose enclosure or parent environment
>                                        # is the base environment
>                                        # (as opposed to the global environment)
> env_of_envs <- new.env()               # User-defined environment that contains other environments
> with(env_of_envs, env11 <- new.env()) # Environment defined inside environment env_of_envs
> 
> # Retrieve the environment name
> environment_name(env1)                       # named array with value "env1" and name "R_GlobalEnv"
[1] "env1"
> environment_name(env3)                       # named array with value "env3" and name "R_GlobalEnv"
[1] "env3"
> environment_name(env9)                       # NULL (env9 does not exist)
NULL
> environment_name(env_of_envs)                # named array with value "env_of_envs" and name
[1] "env_of_envs"
>                                              # "R_GlobalEnv"
> environment_name(env11, envir=env_of_envs)   # "env11"
[1] "env11"
> environment_name(env11)                      # named array with value "env11" and name
[1] "env_of_envs$env11"
>                                              # "R_GlobalEnv$env_of_envs"
> 
> 
> ### Example 2: Retrieve calling functions and their environments
> ### Note in particular the complicated use of sys.call() to retrieve the call as a string... 
> # Define two environments
> env1 <- new.env()
> env2 <- new.env()
> # Define function g() in environment env2 to be called by function f() below
> # Function g() prints the name of the calling function.
> with(env2,
+      g <- function(x) {
+        # Current function name
+        fun_current_name = get_fun_name()
+ 
+        # Get the name of the calling environment and function
+ 			 fun_calling_name = get_fun_calling()
+ 
+        # Show calling environment using and not using the envnames package
+        cat("Now inside function", fun_current_name, "\n")
+        cat("Calling environment name (using environmentName(parent.frame())):  \"",
+             environmentName(parent.frame()), "\"\n", sep="")
+        cat("Calling environment name (using sys.call(1) inside
+            'as.character( as.list(sys.call(1))[[1]]) ))':", " \"",
+             as.character( as.list(sys.call(1))[[1]]), "\"\n", sep="")
+        cat("Calling environment name (using envnames::get_fun_calling()): \"",
+            fun_calling_name, "\"\n", sep="")
+ 
+        # Start process
+        x = x + 2;
+        return(invisible(x))
+      }
+ )
> 
> # Calling function whose name should be printed when g() is run
> with(env1,
+      f <- function(x) {
+        # Start
+        gval = env2$g(x)
+        return(invisible(gval))
+      }
+ )
> 
> # Run function f to show the difference between using and
> # not using the envnames package to retrieve the function calling stack.
> env1$f(7)
Error in `[[<-.data.frame`(`*tmp*`, i, value = NA_character_) : 
  replacement has 1 row, data has 0
Calls: <Anonymous> ... [<-.data.frame -> xpdrows.data.frame -> [[<- -> [[<-.data.frame
Execution halted