Version: | 1.3-0.0 |
Date: | 2022-2-18 |
Title: | Cardinal to Ordinal Number & Date Conversion |
Description: | Language specific cardinal to ordinal number conversion. |
Maintainer: | Damian W. Betebenner <dbetebenner@nciea.org> |
Depends: | R (≥ 3.3) |
Suggests: | knitr, rmarkdown |
Imports: | crayon, testthat |
URL: | https://centerforassessment.github.io/toOrdinal/, https://github.com/centerforassessment/toOrdinal/, https://cran.r-project.org/package=toOrdinal |
BugReports: | https://github.com/centerforassessment/toOrdinal/issues/ |
VignetteBuilder: | knitr |
LazyLoad: | Yes |
ByteCompile: | TRUE |
License: | GPL-3 |
NeedsCompilation: | no |
Packaged: | 2022-02-20 10:19:18 UTC; conet |
Author: | Damian W. Betebenner [aut, cre], Andrew Martin [ctb], Jeff Erickson [ctb] |
Repository: | CRAN |
Date/Publication: | 2022-02-24 11:00:02 UTC |
Cardinal to Ordinal Number Conversion
Description
Language specific cardinal to ordinal number conversion.
Details
Package: | toOrdinal |
Type: | Package |
Version: | 1.3-0.0 |
Date: | 2022-2-18 |
License: | GPL-3 |
LazyLoad: | yes |
Author(s)
Damian W. Betebenner DBetebenner@nciea.org
Cardinal to ordinal number conversion function
Description
Function for converting cardinal to ordinal numbers by adding a language specific ordinal indicator (http://en.wikipedia.org/wiki/Ordinal_indicator) to the number.
Usage
toOrdinal(
cardinal_number,
language="English",
convert_to="ordinal_number")
Arguments
cardinal_number |
Postive integer (cardinal number) to be converted to an ordinal number. For example 1 becomes 1st, 2 becomes 2nd, ... |
language |
OPTIONAL. Language (defaults to English) indicating what language rules to use in conversion to ordinal number. |
convert_to |
OPTIONAL. Output type that provided 'cardinal_number' is converted into. Default is 'ordinal_number' which refers to the 'cardinal_number' followed by the appropriate ordinal indicator. Additional options planned include 'ordinal_word'. |
Details
Typical use of the function is to submit a positive integer for conversion to an ordinal number in the language specified. See examples.
Value
Function returns the ordinal number or ordinal word (as a character string).
Author(s)
Damian W. Betebenner dbetebenner@nciea.org
Examples
toOrdinal(1) ## 1st
toOrdinal(1, language="French") ## 1re
toOrdinal(1:20) ## 1st, 2nd, 3rd, ...
toOrdinal(1:25, language="French") ## 1re, 2e, 3e, ...
Convert date to ordinal calendar date
Description
Function for converting a calendar date to it long, ordinal version.
Usage
toOrdinalDate(
date=NULL,
language="English")
Arguments
date |
Either NULL (the default which uses the current date returned via |
language |
OPTIONAL. Language (defaults to English) indicating what language rules to use in conversion to ordinal number. |
Details
Typical use of the function is to call the function with any argument to get the current date in long, ordinal form. See examples.
Value
Function returns the character string with the long, ordinal calendar date.
Author(s)
Damian W. Betebenner dbetebenner@nciea.org
Examples
toOrdinalDate()
toOrdinalDate("2017-10-9") ## October 9th, 2017
toOrdinalDate("2017-10-09") ## October 9th, 2017
toOrdinalDate(c("2022-11-21", "2019-1-3", "1976-2-2", "1965-2-18"))
## "November 21st, 2022" "January 3rd, 2019" "February 2nd, 1976" "February 18th, 1965"