ck_generate_rkeys: Generate random record keys

View source: R/ck_generate_rkeys.R

ck_generate_rkeysR Documentation

Generate random record keys

Description

This function allows to create random record keys from a uniform distribution. If no seed is specified, a seed value is computed from the input data set to allow for reproducability depending on the input data set.

Usage

ck_generate_rkeys(dat, nr_digits = 8, seed = NULL)

Arguments

dat

microdata used to generated hash for random seed

nr_digits

maximum number of digits in the record keys. The default setting (8) corresponds with the default setting of the method in tau-argus.

seed

if not NULL, a number specifying the initial seed value for the random number generator. If NULL, a seed is computed from dat itself.

Value

a numeric vector with nrow(dat) record keys

Examples

dat <- ck_create_testdata()
dat$rkeys <- ck_generate_rkeys(dat = ck_create_testdata(), nr_digits = 8)

sdcTools/cellKey documentation built on Dec. 5, 2023, 1:05 a.m.