powered by
This function calculates the selected category based on a given value and the total number of categories.
calculate_selected_category(value, num_categories)
The calculated selected category.
The value to calculate the category for.
The total number of categories.
selected_category <- calculate_selected_category(0.3, 5)
Run the code above in your browser using DataLab