parser->records_per_case),
parser->records_per_case, fh_get_name (fh));
struct pivot_table *table = pivot_table_create__ (
- pivot_value_new_user_text (title, -1));
+ pivot_value_new_user_text (title, -1), "Fixed Data Records");
free (title);
pivot_dimension_create (
{
struct pivot_table *table = pivot_table_create__ (
pivot_value_new_text_format (N_("Reading free-form data from %s."),
- fh_get_name (fh)));
+ fh_get_name (fh)),
+ "Free-Form Data Records");
pivot_dimension_create (
table, PIVOT_AXIS_COLUMN, N_("Attributes"), N_("Format"));
/* Table of valid encodings. */
struct pivot_table *table = pivot_table_create__ (
pivot_value_new_text_format (N_("Usable encodings for %s."),
- fh_get_name (h)));
+ fh_get_name (h)), "Usable Encodings");
table->caption = pivot_value_new_text_format (
N_("Encodings that can successfully read %s (by specifying the encoding "
"name on the GET command's ENCODING subcommand). Encodings that "
/* Table of alternative interpretations. */
table = pivot_table_create__ (
pivot_value_new_text_format (N_("%s Encoded Text Strings"),
- fh_get_name (h)));
+ fh_get_name (h)),
+ "Alternate Encoded Text Strings");
table->caption = pivot_value_new_text (
N_("Text strings in the file dictionary that the previously listed "
"encodings interpret differently, along with the interpretations."));
: pivot_value_new_text_format (N_("Recoding %s into %s."),
spec->src_name,
var_get_name (spec->dst)));
- struct pivot_table *table = pivot_table_create__ (title);
+ struct pivot_table *table = pivot_table_create__ (title, "Recoding");
pivot_dimension_create (
table, PIVOT_AXIS_COLUMN, N_("Attributes"),
}
struct pivot_table *table = pivot_table_create__ (
- pivot_value_new_variable (var));
+ pivot_value_new_variable (var), "Chisquare");
pivot_table_set_weight_var (table, dict_get_weight (dict));
pivot_dimension_create (
free (s);
}
struct pivot_table *table = pivot_table_create__ (
- pivot_value_new_user_text_nocopy (ds_steal_cstr (&title)));
+ pivot_value_new_user_text_nocopy (ds_steal_cstr (&title)),
+ "Crosstabulation");
pivot_table_set_weight_format (table, &proc->weight_format);
table->omit_empty = true;
const struct freq_tab *ft = &vf->tab;
struct pivot_table *table = pivot_table_create__ (pivot_value_new_variable (
- vf->var));
+ vf->var), "Frequencies");
pivot_table_set_weight_var (table, wv);
pivot_dimension_create (table, PIVOT_AXIS_COLUMN, N_("Statistics"),
const struct dictionary *dict)
{
struct pivot_table *table = pivot_table_create__ (
- pivot_value_new_user_text_nocopy (make_pair_name (vp)));
+ pivot_value_new_user_text_nocopy (make_pair_name (vp)), "Frequencies");
pivot_table_set_weight_var (table, dict_get_weight (dict));
struct pivot_dimension *vars[2];
struct pivot_table *table = pivot_table_create__ (
pivot_value_new_user_text_nocopy (xasprintf (
_("Multiple Comparisons (%s)"),
- var_to_string (cmd->vars[v]))));
+ var_to_string (cmd->vars[v]))),
+ "Multiple Comparisons");
table->omit_empty = true;
struct pivot_dimension *statistics = pivot_dimension_create (
{
struct pivot_table *table = pivot_table_create__ (
pivot_value_new_text_format (N_("Model Summary (%s)"),
- var_to_string (var)));
+ var_to_string (var)),
+ "Model Summary");
pivot_dimension_create (table, PIVOT_AXIS_COLUMN, N_("Statistics"),
N_("R"), N_("R Square"), N_("Adjusted R Square"),
const struct variable *var)
{
struct pivot_table *table = pivot_table_create__ (
- pivot_value_new_text_format (N_("Coefficients (%s)"),
- var_to_string (var)));
+ pivot_value_new_text_format (N_("Coefficients (%s)"), var_to_string (var)),
+ "Coefficients");
struct pivot_dimension *statistics = pivot_dimension_create (
table, PIVOT_AXIS_COLUMN, N_("Statistics"));
reg_stats_anova (const struct linreg * c, const struct variable *var)
{
struct pivot_table *table = pivot_table_create__ (
- pivot_value_new_text_format (N_("ANOVA (%s)"), var_to_string (var)));
+ pivot_value_new_text_format (N_("ANOVA (%s)"), var_to_string (var)),
+ "ANOVA");
pivot_dimension_create (table, PIVOT_AXIS_COLUMN, N_("Statistics"),
N_("Sum of Squares"), PIVOT_RC_OTHER,
{
struct pivot_table *table = pivot_table_create__ (
pivot_value_new_text_format (N_("Coefficient Correlations (%s)"),
- var_to_string (var)));
+ var_to_string (var)),
+ "Coefficient Correlations");
for (size_t i = 0; i < 2; i++)
{
#include "data/variable.h"
#include "libpspp/hash-functions.h"
#include "libpspp/i18n.h"
+#include "output/driver.h"
#include "gl/c-ctype.h"
#include "gl/intprops.h"
/* Creates and returns a new pivot table with the given TITLE. TITLE should be
a text string marked for translation but not actually translated yet,
- e.g. N_("Descriptive Statistics").
+ e.g. N_("Descriptive Statistics"). The un-translated text string is used as
+ the pivot table's subtype.
Operations commonly performed on the new pivot_table:
This function is a shortcut for pivot_table_create__() for the most common
case. Use pivot_table_create__() directly if the title should be some kind
- of value other than an ordinary text string.
+ of value other than an ordinary text string, or if the subtype should be
+different from the title.
See the large comment at the top of pivot-table.h for general advice on
creating pivot tables. */
struct pivot_table *
pivot_table_create (const char *title)
{
- return pivot_table_create__ (pivot_value_new_text (title));
+ return pivot_table_create__ (pivot_value_new_text (title), title);
}
/* Creates and returns a new pivot table with the given TITLE, and takes
- ownership of TITLE.
+ ownership of TITLE. The new pivot table's subtype is SUBTYPE, which
+ should be an untranslated English string that describes the contents of
+ the table at a high level without being specific about the variables or
+ other context involved.
Operations commonly performed on the new pivot_table:
See the large comment at the top of pivot-table.h for general advice on
creating pivot tables. */
struct pivot_table *
-pivot_table_create__ (struct pivot_value *title)
+pivot_table_create__ (struct pivot_value *title, const char *subtype)
{
struct pivot_table *table = xzalloc (sizeof *table);
table->ref_cnt = 1;
table->weight_format = (struct fmt_spec) { FMT_F, 40, 0 };
table->title = title;
+ table->subtype = pivot_value_new_text (subtype);
+
+ const char *command_id = output_get_command_name ();
+ table->command_c = command_id ? xstrdup (command_id) : NULL;
table->sizing[TABLE_HORZ].range[0] = 50;
table->sizing[TABLE_HORZ].range[1] = 72;
pivot_table_create_for_text (struct pivot_value *title,
struct pivot_value *content)
{
- struct pivot_table *table = pivot_table_create__ (title);
+ struct pivot_table *table = pivot_table_create__ (title, "Error");
struct pivot_dimension *d = pivot_dimension_create (
table, PIVOT_AXIS_ROW, N_("Error"));
/* Titles. */
struct pivot_value *title;
- struct pivot_value *subtype; /* Same as pivot_item's subtype. */
+ struct pivot_value *subtype; /* Same as spv_item's subtype. */
struct pivot_value *corner_text;
struct pivot_value *caption;
char *notes;
/* Creating and destroy pivot tables. */
struct pivot_table *pivot_table_create (const char *title);
-struct pivot_table *pivot_table_create__ (struct pivot_value *title);
+struct pivot_table *pivot_table_create__ (struct pivot_value *title,
+ const char *subtype);
struct pivot_table *pivot_table_create_for_text (struct pivot_value *title,
struct pivot_value *content);