Skip to content

Combining POSIXlt and POSIXct yield an infinite loop #1013

@ThierryO

Description

@ThierryO

Combining POXIXlt and POSIXct work using only base R

old_ct <- as.POSIXct("1900-01-01 01:02:03")
old_lt <- as.POSIXlt("1900-01-01 01:02:03")
x <- c(old_ct, old_lt)

Loading lubridate results in an infinite loop

library(lubridate)
x <- c(old_ct, old_lt)
# Error: C stack usage  7973012 is too close to the limit

.recursive_posixct_unclass <- function(x, tz = "UTC") {

session info

─ Session info ─────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.1.2 (2021-11-01)
 os       Ubuntu 20.04.3 LTS
 system   x86_64, linux-gnu
 ui       RStudio
 language nl_BE:nl
 collate  nl_BE.UTF-8
 ctype    nl_BE.UTF-8
 tz       Europe/Brussels
 date     2022-01-12
 rstudio  2022.02.0-daily+366 Prairie Trillium (desktop)
 pandoc   2.14.0.3 @ /usr/bin/pandoc

 ─ Packages ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package     * version date (UTC) lib source
 cli           3.1.0   2021-10-27 [1] CRAN (R 4.1.2)
 fortunes      1.5-4   2016-12-29 [1] CRAN (R 4.1.0)
 generics      0.1.1   2021-10-25 [1] CRAN (R 4.1.1)
 lubridate   * 1.8.0   2022-01-12 [1] Github (tidyverse/lubridate@46d8d19)
 sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.1.2)

 [1] /home/thierry/R/x86_64-pc-linux-gnu-library/4.0
 [2] /usr/local/lib/R/site-library
 [3] /usr/lib/R/site-library
 [4] /usr/lib/R/library

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions