When using as.Date(), "1 argument passed to .Internal(Date2POSIXlt) which requires 2" error

83 views Asked by At

I have been running a script for almost three years uninterrupted. I updated R yesterday and now I have the following breaking error, which I have found is in the by as.Date function.

example_date <- "11/18/2023"
as.Date(example_date, format = "%m/%d/%Y")

## error: 
# Error in as.POSIXlt.Date(x) : 
#  1 argument passed to .Internal(Date2POSIXlt) which requires 2

> sessionInfo()
R version 4.3.2 (2023-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] tidyr_1.3.0         writexl_1.4.2       lubridate_1.9.3     dplyr_1.1.3        
[5] googleAuthR_2.0.1   googlesheets4_1.1.1

loaded via a namespace (and not attached):
 [1] jsonlite_1.8.8    crayon_1.5.2      compiler_4.2.2    promises_1.2.1    tidyselect_1.2.0 
 [6] Rcpp_1.0.11       assertthat_0.2.1  later_1.3.1       fastmap_1.1.1     R6_2.5.1         
[11] generics_0.1.3    curl_5.1.0        tibble_3.2.1      openssl_2.1.1     pillar_1.9.0     
[16] rlang_1.1.2       utf8_1.2.4        cachem_1.0.8      httpuv_1.6.12     fs_1.6.3         
[21] pkgload_1.3.3     timechange_0.2.0  memoise_2.0.1     cli_3.6.2         magrittr_2.0.3   
[26] digest_0.6.33     rstudioapi_0.15.0 askpass_1.2.0     lifecycle_1.0.4   vctrs_0.6.4      
[31] gargle_1.5.2      glue_1.6.2        cellranger_1.1.0  googledrive_2.1.1 fansi_1.0.5      
[36] purrr_1.0.2       httr_1.4.7        tools_4.2.2       pkgconfig_2.0.3  

Any ideas on how to troubleshoot are welcome.

0

There are 0 answers