uribo / zipangu

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

jholiday()の結果の並び替え #46

Closed uribo closed 2 years ago

uribo commented 2 years ago

Summary

開発版で生じている問題

# CRAN version
withr::with_package("zipangu", {
  names(jholiday(2021, lang = "jp"))
})
#>  [1] "元日"         "成人の日"     "建国記念の日" "天皇誕生日"   "春分の日"    
#>  [6] "昭和の日"     "憲法記念日"   "みどりの日"   "こどもの日"   "海の日"      
#> [11] "スポーツの日" "山の日"       "敬老の日"     "秋分の日"     "文化の日"    
#> [16] "勤労感謝の日"

# Development version
withr::with_temp_libpaths({
  remotes::install_github("uribo/zipangu")
  names(zipangu::jholiday(2021, lang = "jp"))
})
#> Using github PAT from envvar GITHUB_PAT
#> Downloading GitHub repo uribo/zipangu@HEAD
#> 
#> * checking for file ‘/private/var/folders/7f/g31qsmpx03j5m9054l89cb200000gn/T/Rtmp0VZTMu/remotes170d45a04a5a0/uribo-zipangu-b60a7a4/DESCRIPTION’ ... OK
#> * preparing ‘zipangu’:
#> * checking DESCRIPTION meta-information ... OK
#> * installing the package to process help pages
#> * checking for LF line-endings in source and make files and shell scripts
#> * checking for empty or unneeded directories
#> * building ‘zipangu_0.2.3.9000.tar.gz’
#>  パッケージを '/private/var/folders/7f/g31qsmpx03j5m9054l89cb200000gn/T/Rtmp0VZTMu/temp_libpath170d43d7d5d32' 中にインストールします 
#>  ('lib' が指定されていないため)
#>  [1] "元日"         "成人の日"     "建国記念の日" "春分の日"     "昭和の日"    
#>  [6] "みどりの日"   "天皇誕生日"   "憲法記念日"   "こどもの日"   "海の日"      
#> [11] "山の日"       "敬老の日"     "秋分の日"     "スポーツの日" "文化の日"    
#> [16] "勤労感謝の日"

Created on 2022-03-11 by the reprex package (v2.0.1)

天皇誕生日は2021-02-23なので本来は建国記念日の後にくるが開発版ではみどりの日の後となっています。これを修正するための処理を加えました。

withr::with_temp_libpaths({
  remotes::install_github("uribo/zipangu@feature/jholiday_sort")
  names(zipangu::jholiday(2021, lang = "jp"))
})
#> Using github PAT from envvar GITHUB_PAT
#> Downloading GitHub repo uribo/zipangu@feature/jholiday_sort
#> 
#> * checking for file ‘/private/var/folders/_k/8syww8ls39n5dkvwy1yk8dgc0000gn/T/RtmpxMz5a5/remotescc76f45029d/uribo-zipangu-f940d1c/DESCRIPTION’ ... OK
#> * preparing ‘zipangu’:
#> * checking DESCRIPTION meta-information ... OK
#> * installing the package to process help pages
#> * checking for LF line-endings in source and make files and shell scripts
#> * checking for empty or unneeded directories
#> * building ‘zipangu_0.2.3.9000.tar.gz’
#> Installing package into '/private/var/folders/_k/8syww8ls39n5dkvwy1yk8dgc0000gn/T/RtmpxMz5a5/temp_libpathcc728da460f'
#> (as 'lib' is unspecified)
#>  [1] "元日"         "成人の日"     "建国記念の日" "天皇誕生日"   "春分の日"    
#>  [6] "昭和の日"     "憲法記念日"   "みどりの日"   "こどもの日"   "海の日"      
#> [11] "スポーツの日" "山の日"       "敬老の日"     "秋分の日"     "文化の日"    
#> [16] "勤労感謝の日"

Created on 2022-03-11 by the reprex package (v2.0.1)

Related issues

なし