Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sentence

Sentence style identifiers


Description

Create a sentence style identifier. This uses the approach described by Asana on their blog https://blog.asana.com/2011/09/6-sad-squid-snuggle-softly/. This approach encodes 32 bits of information (so 2^32 ~= 4 billion possibilities) and in theory can be remapped to an integer if you really wanted to.

Usage

sentence(n = 1, style = "snake", past = FALSE)

Arguments

n

number of ids to return. If NULL, it instead returns the generating function

style

Style to join words with. Can be one of "Pascal", "camel", "snake", "kebab", "dot", "title", "sentence", "lower", "upper", and "constant".

past

Use the past tense for verbs (e.g., slurped or jogged rather than slurping or jogging)

Author(s)

Rich FitzJohn

Examples

# Generate an identifier
sentence()

# Generate a bunch
sentence(10)

# As with adjective_animal, use "style" to control punctuation
sentence(style = "Camel")
sentence(style = "dot")
sentence(style = "Title")

# Change the tense of the verb:
set.seed(1)
sentence()
set.seed(1)
sentence(past = TRUE)

# Pass n = NULL to bind arguments to a function
id <- sentence(NULL, past = TRUE, style = "dot")
id()
id(10)

ids

Generate Random Identifiers

v1.0.1
MIT + file LICENSE
Authors
Rich FitzJohn [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.