uribo / zipangu

Japanese utility functions and data
https://uribo.github.io/zipangu
Other
56 stars 7 forks source link

is_jholiday fails if the date argument contains NA #39

Closed hidekoji closed 2 years ago

hidekoji commented 2 years ago

is_jholiday fails if the date argument contains NA. Here is the reproducible test case.

zipangu::is_jholiday(c("2019-01-01", NA, "2021-01-01"))
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'as_date': missing value where TRUE/FALSE needed

Created on 2022-02-21 by the reprex package (v2.0.1)

> sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.6

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] zipangu_0.2.3.9000

loaded via a namespace (and not attached):
 [1] rstudioapi_0.13 knitr_1.36      magrittr_2.0.1  R6_2.5.1        rlang_0.4.12    fastmap_1.1.0   fansi_0.5.0    
 [8] highr_0.9       tools_4.1.0     xfun_0.27       utf8_1.2.2      cli_3.1.0       clipr_0.7.1     withr_2.4.2    
[15] htmltools_0.5.2 ellipsis_0.3.2  yaml_2.2.1      digest_0.6.28   tibble_3.1.5    lifecycle_1.0.1 crayon_1.4.2   
[22] processx_3.5.2  callr_3.7.0     ps_1.6.0        vctrs_0.3.8     fs_1.5.0        glue_1.4.2      evaluate_0.14  
[29] rmarkdown_2.11  reprex_2.0.1    compiler_4.1.0  pillar_1.6.4    pkgconfig_2.0.3
>