gpw13 / billionaiRe

Calculate the WHO Triple Billions
https://gpw13.github.io/billionaiRe/
GNU General Public License v3.0
7 stars 4 forks source link

Replace `*_col` arguments with a single mapping #57

Closed mjkanji closed 2 years ago

mjkanji commented 2 years ago

Instead of having multiple arguments like ind_col = "ind", we could continue to provide the ability to have non-standard names for columns by simply moving these mapping to a single col_names or col_mappings argument that is NULL by default (meaning we expect the standard column names).

The user could then provide a named vector/list to provide a mapping of non-standard column names to the standard names. This could then be passed to dplyr::rename() to maintain the same functionality without the overhead of maintaining a long list of arguments of this type.

ElliottMess commented 2 years ago

After further relfexion, it is probably more appropriate to only keep value, transform_value and scenario as parameters and enforce the use of standard column names for the other columns that are in functions parameters.

The parameters are renamed with the suffix _col.