MapDimToOptions: MapDimToOptions(data, items_to_options, allocate)

View source: R/Utility-Functions.R

MapDimToOptionsR Documentation

MapDimToOptions(data, items_to_options, allocate)

Description

A function that maps dimensions from a dataframe to the options sets

Usage

MapDimToOptions(data, items_to_options, allocate)

Arguments

data

dataframe - dimension name and dimension UID, along with the quantity

items_to_options

dimension item sets dataframe filtered by one of the model sets

allocate

If allocate is set to "distriute", mutates a column in the returned df with the weight being multiplied to the value

Value

If there are no options provided, returns the analytics output, else if there are no dim_uid in the options list, joins the data using crossing or left join, else if the allocation is set to "distriute", then renames them adds a value column and finally performs the renaming of the dimension columns.


pepfar-datim/data-pack-commons documentation built on Feb. 6, 2024, 9:46 p.m.