Learn R Programming

nprcgenekeepr (version 2.0.0)

obfuscatePed: Obfuscate a pedigree by aliasing IDs and shifting dates

Description

User provides a pedigree object (ped), the number of characters to be used for alias IDs (size), and the maximum number of days that the birthdate can be shifted (maxDelta).

Usage

obfuscatePed(
  ped,
  size = 6L,
  maxDelta = 30L,
  existingIds = character(0L),
  map = FALSE
)

Value

An obfuscated pedigree

Arguments

ped

The pedigree information in data.frame format

size

integer value indicating number of characters in alias IDs

maxDelta

integer value indicating maximum number of days that the birthdate can be shifted

existingIds

character vector of existing aliases to avoid duplication.

map

logical if TRUE a list object is returned with the new pedigree and a named character vector with the names being the original IDs and the values being the new alias values. Defaults to FALSE.

See Also

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

Examples

Run this code
library(nprcgenekeepr)
ped <- qcStudbook(nprcgenekeepr::pedGood)
obfuscatedPed <- obfuscatePed(ped)
ped
obfuscatedPed

Run the code above in your browser using DataLab