Learn R Programming

sdglinkage (version 0.1.0)

replace_nhsid: Replace nhsid with another random nhsid.

Description

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

Usage

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

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataLab