An Ark object can create and remember pseudonyms. Given the same input, it will always return the same pseudonym. No pseudonym will repeat.

Public fields

log

Hashtable for all used pseudonyms. Inputs (keys) are stored as hashes.

Methods

Public methods


Method new()

Create new ark object.

Usage

Ark$new(alliterate = FALSE, parts = NULL, seed = NULL)

Arguments

alliterate

Logical. Should the Ark return alliterations by default?

parts

List of character vectors with name parts to be used for the pseudonyms. Defaults to adjectives and animals.

seed

Random seed for permutation of name parts. Use this to make Ark reproducible (to the extent that the random number generation is reproducible). If NULL (default), the random number generator is left alone. This is a convenience argument and equivalent to calling set.seed() before creating the Ark.

Returns

A new Ark object.


Method pseudonymize()

Create Pseudonyms for input.

Usage

Ark$pseudonymize(..., .alliterate = NULL)

Arguments

...

One or more R objects.

.alliterate

Logical. Return only pseudonyms that are alliterations. Defaults to TRUE if the Ark was created with Ark$new(alliterate = TRUE), FALSE otherwise. If FALSE, pseudonyms may still be alliterations by coincidence.

Returns

Character vector of pseudonyms with same length as input.


Method print()

Pretty-print an Ark object.

Usage

Ark$print(n = NULL)

Arguments

n

A positive integer. The number of example pseudonyms to print.


Method length()

Number of used pseudonyms in an Ark.

Usage

Ark$length()


Method length_allit()

Number of used alliterations in an Ark.

Usage

Ark$length_allit()


Method clone()

The objects of this class are cloneable with this method.

Usage

Ark$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.