vectorise_unique | R Documentation |
Title Format full names from a data.table and return unique names per row.
vectorise_unique(x, namecols)
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 |
list of unique names
# 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 = " "))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.