obfuscateId: Create ID aliases of a specified length
Description
ID aliases are pseudorandom sequences of alphanumeric upper case characters
where the letter "O" is not included for readability..
User has the option of providing a character vector of aliases to avoid
using.
Because aliases are alphanumeric, they never contain a period ("."),
honoring the ID rule enforced at data input by qcStudbook.
A named character vector of aliases where the name is the original
ID value.
Arguments
id
character vector of IDs to be obfuscated (alias creation). It
must not contain NA; an NA id stops with a message that gives
its position.
size
character length of each alias. An ID that is a placeholder for
an unknown parent (see removeAutoGenIds) gets an alias of the
same shape, the placeholder prefix plus random characters; when size
is too short for that shape to be recognized (shorter than 5 for the default
"U%04d" format), only those aliases are made longer, to the shortest
recognizable length.
existingIds
character vector of existing aliases to avoid duplication.
placeholder
optional logical vector, one value per id, saying
which ids are placeholders for unknown parents (TRUE) and which are
real animals (FALSE), as recorded in the placeholder column
that qcStudbook writes. A placeholder gets a placeholder-shaped
alias and a real animal a real-shaped one, even when the id's own shape says
otherwise (a real animal named "U1234"). NA or NULL
(the default) reads the id by its shape.
See Also
Other obfuscation:
mapIdsToObfuscated(),
obfuscateDate(),
obfuscateGenomicROH(),
obfuscateGenotypeMatrix(),
obfuscateLdBlocks(),
obfuscateMhcHaplotypes(),
obfuscatePed(),
obfuscateTwinRelations()