Why does strptime result in an infinite list when using View in RStudio?

Viewed 108

Disclaimer: The title of the question might be wrong, because I don't know what causes this behaviour. The 'issue' is that viewing a POSIXlt object in RStudio viewer shows an infinite linked list, as far as I can determine.

MWE:

x <- strptime("2021-01-17", format = "%Y-%m-%d")
class(x)# outputs "POSIXlt" "POSIXt" 
View(x) # Opens the viewer in RStudio

When opening the viewer, you can click 'expand' on each item, and it goes all the way down: Screenshot of the RStudio viewer of the time variable

I can access the content via the console as well, for example typing:

x[[1]][[1]][[1]][[1]][[1]][[1]][[1]][[1]][[1]][[1]][[1]][[1]][[1]][[1]][[1]][[1]][[1]]

The output is always the same: the date "2021-01-17 CET".

What is causing this? I suspect this might be due to RStudio rather than the POSIXlt class itself? I also tried reading the ?strptime documentation but I found no note regarding the output of the function causing this.

0 Answers
Related