Extract a database identifier from an ID column and add it as a separate column.
add_db(
dat,
input_col,
output_col = paste0(input_col, "_db"),
split = ":",
keep = 1
)data.table or tbl_graph.
Column containing IDs.
Column to add.
character vector (or object which can be coerced to such)
containing regular expression(s) (unless fixed = TRUE)
to use for splitting. If empty matches occur, in particular if
split has length 0, x is split into single characters.
If split has length greater than 1, it is re-cycled along
x.
Specify indices corresponding to just those list elements to retain in the transposed result. Default is to return all.