obfuscateId: Create ID aliases of a specified length

View source: R/obfuscateId.R

obfuscateIdR Documentation

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.

Usage

obfuscateId(id, size = 10L, existingIds = character(0L))

Arguments

id

character vector of IDs to be obfuscated (alias creation).

size

character length of each alias

existingIds

character vector of existing aliases to avoid duplication.

Value

A named character vector of aliases where the name is the original ID value.

See Also

Other obfuscation: mapIdsToObfuscated(), obfuscateDate(), obfuscatePed()

Examples

library(nprcgenekeepr)
integerIds <- 1L:10L
obfuscateId(integerIds, size = 4L)
characterIds <- paste0(paste0(sample(LETTERS, 1L, replace = FALSE)), 1L:10L)
obfuscateId(characterIds, size = 4L)

nprcgenekeepr documentation built on July 26, 2026, 5:06 p.m.