| make_aux | R Documentation |
Auxiliary columns condition the synthesis (so cross-table associations survive a later join) but are never censored or written out.
make_aux(
src,
by,
aux_src,
aux_spec,
aux_by,
cols = NULL,
key_fun = function(k) toupper(gsub("[^A-Za-z0-9]", "", k))
)
src |
The table being synthesised ( |
by |
Key column of |
aux_src |
The other table ( |
aux_spec |
Spec of |
aux_by |
Key column of |
cols |
Columns of |
key_fun |
Function normalising keys before matching (e.g. dropping a
hyphen so |
list(raw, roles), rows aligned to src$raw (first match per key).
df <- data.frame(id = sprintf("AB%03d", 1:60), value = 1:60)
other <- data.frame(id = rev(df$id), code = rep(c(0, 1, NA), 20))
path <- file.path(tempdir(), "make_aux_main.csv")
aux_path <- file.path(tempdir(), "make_aux_other.csv")
utils::write.csv(df, path, row.names = FALSE, na = "")
utils::write.csv(other, aux_path, row.names = FALSE, na = "")
src <- read_source(path)
aux_src <- read_source(aux_path)
aux_spec <- infer_spec(aux_src)
aux <- make_aux(src, by = "id", aux_src = aux_src,
aux_spec = aux_spec, aux_by = "id", cols = "code")
head(aux$raw)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.