insightsengineering/cards

Add function to add a row to an ARD

Closed this issue · 0 comments

Sometimes we need to add additional statistics to an ARD that is a function of the returned statistics, and that can be a little tricky to get everything in the right format. For example, if I have a quartiles and we want to add the scalar IQR, or there is a PASS/FAIL criteria and we need to add a row with the text "PASS" or "FAIL".

We could provide a function that can calculate the stats and append the results

ard_add_calculated_row(x = ard, stat = p75 - p25, stat_name = "iqr", stat_label = "IQR", by = all_ard_groups())