Running examples in ‘healthequal-Ex.R’ failed
The error most likely occurred in:

> ### Name: rii
> ### Title: Relative index of inequality (RII)
> ### Aliases: rii
> 
> ### ** Examples
> 
> # example code 1
> data(IndividualSample)
> head(IndividualSample)
  id  psu strata   weight             subgroup subgroup_order sba dtp3
1  1   88      1 0.351672           Quintile 3              3   1   NA
2  2 1337     38 0.431545 Quintile 1 (poorest)              1   1    1
3  3  450     18 0.482483           Quintile 2              2   1   NA
4  4 1692     56 0.407390 Quintile 1 (poorest)              1   0   NA
5  5  752     23 1.547062 Quintile 5 (richest)              5   1   NA
6  6 1033     30 2.429523 Quintile 5 (richest)              5   1   NA
  favourable_indicator indicator_scale
1                    1             100
2                    1             100
3                    1             100
4                    1             100
5                    1             100
6                    1             100
> with(IndividualSample,
+      rii(est = sba,
+          subgroup_order = subgroup_order,
+          weight = weight,
+          psu = psu,
+          strata = strata))
  measure estimate         se  lowerci  upperci
1     rii 2.038107 0.03503773 1.902842 2.182987
> # example code 2
> data(OrderedSample)
> head(OrderedSample)
                                        indicator
1 Births attended by skilled health personnel (%)
2 Births attended by skilled health personnel (%)
3 Births attended by skilled health personnel (%)
4 Births attended by skilled health personnel (%)
5 Births attended by skilled health personnel (%)
                          dimension             subgroup subgroup_order
1 Economic status (wealth quintile) Quintile 1 (poorest)              1
2 Economic status (wealth quintile)           Quintile 2              2
3 Economic status (wealth quintile)           Quintile 3              3
4 Economic status (wealth quintile)           Quintile 4              4
5 Economic status (wealth quintile) Quintile 5 (richest)              5
  estimate        se population setting_average favourable_indicator
1 75.60530 1.5996131   2072.436        91.59669                    1
2 91.01997 1.1351504   2112.204        91.59669                    1
3 96.03959 0.6461946   1983.059        91.59669                    1
4 97.04223 0.5676206   2052.124        91.59669                    1
5 99.22405 0.2237683   1884.510        91.59669                    1
  ordered_dimension indicator_scale
1                 1             100
2                 1             100
3                 1             100
4                 1             100
5                 1             100
> with(OrderedSample,
+      rii(est = estimate,
+          subgroup_order = subgroup_order,
+          pop = population))
Error in `[.data.table`(out, , `:=`(tmp_idx, seq_len(.N)), by = tmp) : 
  attempt access index 13/13 in VECTOR_ELT
Calls: with ... <Anonymous> -> do.call -> get_comparisons -> [ -> [.data.table
Execution halted