replace_nhsid: Replace nhsid with another random nhsid.

Description Usage Arguments Value Examples

View source: R/mask_sensitive_variable.R

Description

replace_nhsid replaces the nhsid in dataset with another random nhsid in case they are too sensitive.

Usage

1
replace_nhsid(dataset)

Arguments

dataset

A data frame of the dataset.

Value

A data frame of the dataset with the nhsid column being replaced by random nhsid.

Examples

1
2
3
4
df <- data.frame(sex=sample(c('male', 'female'), 100, replace = TRUE))
df$race <- sample(1:6, 100, replace = TRUE)
df <- add_variable(df, "nhsid")
replace_nhsid(df)

sdglinkage documentation built on April 27, 2020, 5:09 p.m.