Skip to content
Prev 393472 / 398500 Next

error in exists.....

Hi,

I can't create the desired object using the code you provided, but if
I create it in two steps so that E$L[[i]]$T1A1 does exist, exist()
returns TRUE.

E <- new.env()
E$L <- list()
i <- 1
E$L[[i]]$T1A1 <- Sys.time()

# returns: Error in `*tmp*`[[i]] : subscript out of bounds

E$L[[i]] <- list()
E$L[[i]]$T1A1 <- Sys.time()


exists("T1A1", where = E$L[[i]])
# returns: [1] TRUE
List of 1
 $ :List of 1
  ..$ T1A1: POSIXct[1:1], format: "2022-12-27 12:47:26"

Sarah
On Tue, Dec 27, 2022 at 12:36 PM akshay kulkarni <akshay_e4 at hotmail.com> wrote:

  
    
Message-ID: <CAM_vjunG=FmBLEXcwWT=i1FZL61r2mpEa9wzU6y+C-60D5pobA@mail.gmail.com>
In-Reply-To: <PU4P216MB15680590FF577F4927C5690CC8ED9@PU4P216MB1568.KORP216.PROD.OUTLOOK.COM>