vectorise_unique: Title Format full names from a data.table and return unique...

View source: R/PII_manage.R

vectorise_uniqueR Documentation

Title Format full names from a data.table and return unique names per row.

Description

Title Format full names from a data.table and return unique names per row.

Usage

vectorise_unique(x, namecols)

Arguments

x

data.table or data.frame containing with columns containing messy names

namecols

column names containing names (forename(s), middlename(s), surname(s)) to process

Value

list of unique names

Examples

 # dt <- data.table(first_name = c("Jane", "Pete"), surname = c("Brown", "McKenzie"))
 # dt$namelist <- name_combos(x = dt, namecols =  c("first_name","surname"))
 # Tidy survname column and return a vector of all names per row
 # dt$names <- lapply(vectorise_unique(dt, "names"), function(x) paste0(unlist(sort(x)), collapse = " "))


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