naturalsort: Natural Ordering
- CRAN: http://cran.r-project.org/web/packages/naturalsort/index.html
- GitHub: https://github.com/kos59125/naturalsort
> library(naturalsort)
バージョン: 0.1.2
関数名 | 概略 |
---|---|
naturalsort |
Natural Ordering Sort |
naturalsort-package |
naturalsort |
naturalsort
文字列ベクトルの自然順ソート
> sprintf("hoge%s", 1:12) %>% sample(.) %>% {
+ print(.)
+ sort(.) %>% print()
+ naturalsort(.) %>% print()
+ }
[1] "hoge5" "hoge8" "hoge1" "hoge6" "hoge12" "hoge3" "hoge10"
[8] "hoge7" "hoge2" "hoge4" "hoge11" "hoge9"
[1] "hoge1" "hoge10" "hoge11" "hoge12" "hoge2" "hoge3" "hoge4"
[8] "hoge5" "hoge6" "hoge7" "hoge8" "hoge9"
[1] "hoge1" "hoge2" "hoge3" "hoge4" "hoge5" "hoge6" "hoge7"
[8] "hoge8" "hoge9" "hoge10" "hoge11" "hoge12"