simpleID: Title Create a unique identified based on unique values in...

simpleIDR Documentation

Title Create a unique identified based on unique values in columns and a further unique identifier Assign unique IDs to data based either on PII columns or a combination of PII columns and a further unique identifier where available

Description

Title Create a unique identified based on unique values in columns and a further unique identifier Assign unique IDs to data based either on PII columns or a combination of PII columns and a further unique identifier where available

Usage

simpleID(
  x,
  col = names(x)[grepl("Birth|DOB|Postcode|ZIP|Name", names(x), ignore.case = T)],
  Number = FALSE,
  name = "GroupID"
)

Arguments

x

Data to assign unique IDs to

col

PII columns within data to use for assigning unique IDs

Number

Potentially incomplete unique identifier which can be used in combination with PII to assign unique IDs

name

Name to give unique ID column in output

Value

full dataset with additional ID column returned

Examples

# x <- data.frame(DOB = c("01/01/2001", "02/01/2001", "01/01/2001", "03/01/2001"),
#    name = c("A", "B", "C", "D"), surname = c("A", "B", "A", "D"),
#    ZIP = c("A", "B", "A", "D"), NHS_Number = c(2001, NA, 2001, NA))
# Number = "NHS_Number"
# name <- "GroupID"
# col = c("DOB", "name", "surname", "ZIP")
# x <- simpleID(x = x, col =  col, name = name)
# x <- simpleID(x = x, col =  col, Number = Number, name = name)


DHatziioanou/simpleepi documentation built on Sept. 24, 2024, 5:25 a.m.