VLABELS
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 3 Jun 2022 23:39:59 +0000 (16:39 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 25 Jun 2022 04:19:07 +0000 (21:19 -0700)
src/language/stats/ctables.c
tests/language/stats/ctables.at

index e34621e2fa4ad270ede00e0d80d39059e35edf58..4f231caa7a9f8f6ace7596be97576b52f6dfce3a 100644 (file)
@@ -3405,6 +3405,7 @@ ctables_table_output (struct ctables *ct, struct ctables_table *t)
                 }
                 type;
 
+              enum settings_value_show vlabel; /* CTL_VAR only. */
               size_t var_idx;
             };
           struct ctables_level *levels = xnmalloc (1 + 2 * max_depth, sizeof *levels);
@@ -3416,6 +3417,7 @@ ctables_table_output (struct ctables *ct, struct ctables_table *t)
                 {
                   levels[n_levels++] = (struct ctables_level) {
                     .type = CTL_VAR,
+                    .vlabel = (enum settings_value_show) vlabel,
                     .var_idx = k,
                   };
                 }
@@ -3511,7 +3513,10 @@ ctables_table_output (struct ctables *ct, struct ctables_table *t)
                       const struct variable *var = nest->vars[level->var_idx];
                       struct pivot_value *label;
                       if (level->type == CTL_VAR)
-                        label = pivot_value_new_variable (var);
+                        {
+                          label = pivot_value_new_variable (var);
+                          label->variable.show = level->vlabel;
+                        }
                       else if (level->type == CTL_CATEGORY)
                         {
                           const struct ctables_cell_value *cv = &cell->axes[a].cvs[level->var_idx];
index 34f2605b40be7338aafc26fcada9f8f91c965956..abc18bbb1203f589308eaa0792c0b67641398a45 100644 (file)
@@ -34,7 +34,7 @@ dnl - FORMAT:
 dnl   * MINCOLWIDTH, MAXCOLWIDTH, UNITS.
 dnl   * EMPTY.
 dnl   * MISSING.
-dnl - VLABELS.
+dnl - Test VLABELS.
 dnl - SMISSING (see documentation).
 dnl - Test WEIGHT and adjustment weights.
 dnl - Test PCOMPUTE and PPROPERTIES.