cynthiahqy / conformr-xmap-project

R Package for harmonising data of different classifications or aggregations into a single dataset
MIT License
7 stars 1 forks source link

read/write for `xmap_df` (using positional sorting) #62

Open cynthiahqy opened 1 year ago

cynthiahqy commented 1 year ago
cynthiahqy commented 1 year ago

Names: #54

For WRITING

For READING

cynthiahqy commented 1 year ago

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)