Open cynthiahqy opened 1 year ago
Names: #54
For WRITING
xmap_to_csv(xmap, path)
write_xmap_to_csv
For READING
xmap_from_csv(path, from = NULL, to = NULL, weights = NULL, .keep = TRUE)
read_xmap_from_csv
csv_to_xmap_df(file, col_from = NULL, col_to = NULL, col_weights = NULL, .keep_all = TRUE, ...)
would just be a light wrapper around:
df <- readr::read_csv(file, ...)
col_names <- names(df)
from <- col_from %||% col_names[[1]]
to <- col_to %||% col_names[[2]]
weights <- col_weights %||% col_names[[3]]
xmap <- as_xmap_df(df, from, to, weights, .drop = !.keep)
from,to,weights
,other cols