Skip to content

Latest commit

 

History

History
77 lines (49 loc) · 2.77 KB

README.md

File metadata and controls

77 lines (49 loc) · 2.77 KB

toOrdinal

R-CMD-check AppVeyor Build Status CRAN_Status_Badge Development Version License Join the chat at https://gitter.im/CenterForAssessment/toOrdinal

Overview

The R package toOrdinal contains a single function toOrdinal that converts a cardinal number (e.g., 9) into its ordinal counterpart (e.g., 9th). Because such conversions are language specific, the conversions are specific to a supported language. At present, the package implements English, French, German, Spanish, and Swedish. For example,

  • English: toOrdinal(1) returns '1st'
  • Dutch: toOrdinal(1, language="Dutch") returns '1ste'
  • German: toOrdinal(1, language="German") returns '1te'
  • French: toOrdinal(1, language="French") returns '1re'
  • Spanish: toOrdinal(1, language="Spanish") returns '1.er'
  • Swedish: toOrdinal(1, language="Swedish") returns '1:a'

Installation

From CRAN

To install the latest stable release of toOrdinal from CRAN

> install.packages("toOrdinal")

From Github

To install the development release of toOrdinal from GitHub:

> devtools::install_github("CenterForAssessment/toOrdinal")

Usage

> toOrdinal(5)
[1] "5th"

> toOrdinal(5, language="German")
[1] "5te"

> toOrdinal(5, language="French")
[1] "5e"

> toOrdinal(5, language="Spanish")
[1] "5.º"

> toOrdinal(5, language="Swedish")
1] "5:e"

Resources

Contributors

The toOrdinal Package is crafted with ❤️ by:

I love feedback and am happy to answer questions. Feel free to clone and make a pull request with the specifications for other languages.