naturalsort软件包说明说明书

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Package‘naturalsort’
October13,2022
Type Package
Title Natural Ordering
Version0.1.3
Suggests testthat
Date2016-08-30
Author Kosei Abe
Maintainer Kosei Abe<******************>
Description Provides functions related to human natural ordering.
It handles adjacent digits in a character sequence as a number so that
natural sort function arranges a character vector by their numbers,not digit
characters.It is typically seen when operating systems listsfile names.For
example,a sequence a-1.png,a-2.png,a-10.png looks naturally ordered because1
<2<10and natural sort algorithm arranges so whereas general sort algorithms
arrange it into a-1.png,a-10.png,a-2.png owing to their third and fourth
characters.
License BSD_3_clause+file LICENSE
BugReports https:///kos59125/naturalsort/issues
RoxygenNote5.0.1
NeedsCompilation no
Repository CRAN
Date/Publication2016-08-3012:48:28
R topics documented:
naturalsort-package (2)
naturalfactor (2)
naturalorder (2)
Index4
1
naturalsort-package Natural Ordering Sort
Description
Provides functions related to natural ordering.
naturalfactor Natural Ordering Factor
Description
naturalfactor creates a factor with levels in natural order.
Usage
naturalfactor(x,levels,ordered=TRUE,...)
Arguments
x a character vector.
levels a character vector whose elements might be appeared in x.
ordered logicalflag that determines whether the factor is ordered.
...arguments that are passed to factor function.
naturalorder Natural Ordering Sort
Description
Natural ordering is a kind of alphanumerical ordering.naturalorder returns the order of the argument character#’vector in human natural ascending or descending order.naturalsort returns the sorted vector.
Usage
naturalorder(text,decreasing=FALSE,st=TRUE)
naturalsort(text,decreasing=FALSE,st=NA)
Arguments
text a character vector to sort.
decreasing logical.
st logical.If NA,NA s will be removed of the result.
Value
For naturalorder,the results are indices of vector elements in natural order.For naturalsort, the results are sorted vectors.
Examples
text<-c("a-1.png","a-2.png","a-10.png")
print(sort(text))
print(naturalsort(text))
Index
naturalfactor,2
naturalorder,2
naturalsort(naturalorder),2
naturalsort-package,2
4。

相关文档
最新文档