static struct frq_stats_table *frq_stats_table_submit (
struct frq_stats_table *, const struct frq_proc *,
- const struct dictionary *, const struct variable *wv);
+ const struct dictionary *, const struct variable *wv,
+ const struct ccase *example);
static void frq_stats_table_destroy (struct frq_stats_table *);
static int
calculated. Displays statistics, percentiles, ... */
static struct frq_stats_table *
postcalc (struct frq_proc *frq, const struct dataset *ds,
- struct ccase *first, struct frq_stats_table *fst)
+ struct ccase *example, struct frq_stats_table *fst)
{
const struct dictionary *dict = dataset_dict (ds);
const struct variable *wv = dict_get_weight (dict);
if (frq->n_stats)
{
if (st != SPLIT_LAYERED)
- output_splits_once (&need_splits, ds, first);
- fst = frq_stats_table_submit (fst, frq, dict, wv);
+ output_splits_once (&need_splits, ds, example);
+ fst = frq_stats_table_submit (fst, frq, dict, wv, example);
}
for (size_t i = 0; i < frq->n_vars; i++)
/* Frequencies tables. */
if (vf->tab.n_valid + vf->tab.n_missing <= frq->max_categories)
{
- output_splits_once (&need_splits, ds, first);
+ output_splits_once (&need_splits, ds, example);
dump_freq_table (vf, wv);
}
if (histogram)
{
- output_splits_once (&need_splits, ds, first);
+ output_splits_once (&need_splits, ds, example);
chart_submit (histogram_chart_create (
histogram->gsl_hist, var_to_string(vf->var),
vf->tab.valid_cases,
if (frq->pie)
{
- output_splits_once (&need_splits, ds, first);
+ output_splits_once (&need_splits, ds, example);
do_piechart(frq->pie, vf->var, &vf->tab);
}
if (frq->bar)
{
- output_splits_once (&need_splits, ds, first);
+ output_splits_once (&need_splits, ds, example);
do_barchart(frq->bar, &vf->var, &vf->tab);
}
for (size_t i = 0; i < frq->n_vars; i++)
hmap_init (&frq->vars[i].tab.data);
- struct ccase *first = casereader_peek (group, 0);
+ struct ccase *example = casereader_peek (group, 0);
struct ccase *c;
for (; (c = casereader_read (group)) != NULL; case_unref (c))
calc (frq, c, ds);
- fst = postcalc (frq, ds, first, fst);
+ fst = postcalc (frq, ds, example, fst);
casereader_destroy (group);
- case_unref (first);
+ case_unref (example);
}
frq_stats_table_destroy (fst);
casegrouper_destroy (grouper);
struct pivot_table *table = pivot_table_create (N_("Statistics"));
pivot_table_set_weight_var (table, wv);
- struct pivot_splits *splits = pivot_splits_create (table, dict);
-
struct pivot_dimension *variables
= pivot_dimension_create (table, PIVOT_AXIS_COLUMN, N_("Variables"));
for (size_t i = 0; i < frq->n_vars; i++)
pc->p * 100.0));
}
+ struct pivot_splits *splits = pivot_splits_create (table, PIVOT_AXIS_ROW,
+ dict);
+
struct frq_stats_table *fst = xmalloc (sizeof *fst);
*fst = (struct frq_stats_table) { .table = table, .splits = splits };
return fst;
frq_stats_table_submit (struct frq_stats_table *fst,
const struct frq_proc *frq,
const struct dictionary *dict,
- const struct variable *wv)
+ const struct variable *wv,
+ const struct ccase *example)
{
if (!fst)
{
if (!fst)
return NULL;
}
+ pivot_splits_new_split (fst->splits, example);
int var_idx = 0;
for (size_t i = 0; i < frq->n_vars; i++)
const struct freq_tab *ft = &vf->tab;
int row = 0;
- pivot_table_put2 (fst->table, var_idx, row++,
+ pivot_splits_put2 (fst->splits, fst->table, var_idx, row++,
pivot_value_new_number (ft->valid_cases));
- pivot_table_put2 (fst->table, var_idx, row++,
+ pivot_splits_put2 (fst->splits, fst->table, var_idx, row++,
pivot_value_new_number (
ft->total_cases - ft->valid_cases));
= (j == FRQ_ST_MODE || j == FRQ_ST_MINIMUM || j == FRQ_ST_MAXIMUM
? pivot_value_new_var_value (vf->var, &v)
: pivot_value_new_number (v.f));
- pivot_table_put2 (fst->table, var_idx, row++, pv);
+ pivot_splits_put2 (fst->splits, fst->table, var_idx, row++, pv);
}
for (size_t j = 0; j < frq->n_percentiles; j++)
union value v = {
.f = vf->tab.n_valid ? vf->percentiles[j] : SYSMIS
};
- pivot_table_put2 (fst->table, var_idx, row++,
- pivot_value_new_var_value (vf->var, &v));
+ pivot_splits_put2 (fst->splits, fst->table, var_idx, row++,
+ pivot_value_new_var_value (vf->var, &v));
}
var_idx++;