R: Ordinal Numbers

ordinal {spatstat.utils} | R Documentation

## Ordinal Numbers

### Description

Returns the appropriate abbreviation in English for an ordinal number (for example `ordinal(5)` is `"5th"`).

### Usage

    ordinal(k)
    ordinalsuffix(k)

### Arguments

`k` | An integer or vector of integers.

### Details

`ordinal(k)` returns a character string representing the `k`th ordinal number. `ordinalsuffix(k)` determines the appropriate suffix.

The suffix can be either `"st"` (abbreviating first), `"nd"` (abbreviating second), `"rd"` (abbreviating third) or `"th"` (for all other ordinal numbers `fourth`, `fifth`, etc).

### Value

A character string or character vector of the same length as `k`.

### Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au.

### See Also

`articlebeforenumber`

### Examples

      ordinal(1:7)
      cat(paste("Happy", ordinal(21), "Birthday"), fill=TRUE)

[Package spatstat.utils version 2.3-1 Index]