| Ark {noah} | R Documentation |
A pseudonym archive
Description
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
logHashtable 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
alliterateLogical. Should the Ark return alliterations by default?
partsList of character vectors with name parts to be used for the pseudonyms. Defaults to adjectives and animals.
seedRandom 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.
.alliterateLogical. 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
nA 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
deepWhether to make a deep clone.