From 2402013898889076c67683f1582f90448f4fa6ef Mon Sep 17 00:00:00 2001 From: John Darrington Date: Wed, 13 May 2009 07:29:38 +0800 Subject: [PATCH] Don't create histograms for string variables. Closes bug #26536 --- doc/statistics.texi | 3 ++- src/language/stats/frequencies.q | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/statistics.texi b/doc/statistics.texi index 9cf68498..5430c6bc 100644 --- a/doc/statistics.texi +++ b/doc/statistics.texi @@ -205,12 +205,13 @@ boundaries of the data set divided into the specified number of ranges. For instance, @code{/NTILES=4} would cause quartiles to be reported. The HISTOGRAM subcommand causes the output to include a histogram for -each specified variable. The X axis by default ranges from the +each specified numeric variable. The X axis by default ranges from the minimum to the maximum value observed in the data, but the MINIMUM and MAXIMUM keywords can set an explicit range. The Y axis by default is labeled in frequencies; use the PERCENT keyword to causes it to be labeled in percent of the total observed count. Specify NORMAL to superimpose a normal curve on the histogram. +Histograms are not created for string variables. The PIECHART adds a pie chart for each variable to the data. Each slice represents one value, with the size of the slice proportional to diff --git a/src/language/stats/frequencies.q b/src/language/stats/frequencies.q index 25866a41..ea42475c 100644 --- a/src/language/stats/frequencies.q +++ b/src/language/stats/frequencies.q @@ -606,7 +606,7 @@ postcalc (const struct dataset *ds) - if ( chart == GFT_HIST) + if ( chart == GFT_HIST && var_is_numeric (v) ) { double d[frq_n_stats]; struct histogram *hist ; -- 2.30.2