simpleID | R 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
simpleID(
x,
col = names(x)[grepl("Birth|DOB|Postcode|ZIP|Name", names(x), ignore.case = T)],
Number = FALSE,
name = "GroupID"
)
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 |
full dataset with additional ID column returned
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.