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

Refactor xmap_reverse() `weights_into` behaviour to retain unit weights, and only generate new weights when converting fractional weights. #100

Open cynthiahqy opened 1 year ago

cynthiahqy commented 1 year ago

The current implementation of xmap_reverse() is a bit clunky. it would be better if

Once this is implemented:

Imagine that instead of converting country codes from ISO Numeric to ISO-2 digit, we wanted to convert from ISO-2 digit to ISO Numeric. We can take the existing crossmap and invert it using unit weights:

```{r}
iso_xmap |>
  xmap_reverse()

We can overwrite the existing weights by using the weights_into argument

iso_xmap |>
  xmap_reverse(weights_into = "link")