Open cynthiahqy opened 1 year ago
Maybe rename arguments to be closer to pivot longer? and split out the adding of weights; with add_weights_* variants that return links (3col) like:
add_weights_*
add_weights_unit()
add_weights_equal()
add_weights_custom()
E.g. an aggregation or recode map with unit weights:
link_list <- list(AUS = c("VIC", "NSW", "QLD"), NZ = c("NTH", "STH")) pairs_from_list(link_list, names_to = "name", values_to = "value") |> add_weights_unit(weights_into = "w") |> validate_links_as_xmap(from = value, to = name, weights = w)
This also allows for generating equal weight disaggregation maps:
pairs_from_list(link_list, names_to = "name", values_to = "value") |> add_weights_equal(from = name, to = value, weights_into = "w") |> as_xmap(from = name, to = value, weights = w)
Originally posted by @cynthiahqy in https://github.com/cynthiahqy/conformr-project/issues/66#issuecomment-1512428509
Maybe rename arguments to be closer to pivot longer? and split out the adding of weights; with
add_weights_*
variants that return links (3col) like:add_weights_unit()
which would close #78add_weights_equal()
which would #5add_weights_custom()
which could take a custom func?E.g. an aggregation or recode map with unit weights:
This also allows for generating equal weight disaggregation maps:
Originally posted by @cynthiahqy in https://github.com/cynthiahqy/conformr-project/issues/66#issuecomment-1512428509