From: John Darrington Date: Tue, 12 May 2009 23:29:38 +0000 (+0800) Subject: Don't create histograms for string variables. X-Git-Tag: v0.7.3~127 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2402013898889076c67683f1582f90448f4fa6ef;p=pspp-builds.git Don't create histograms for string variables. Closes bug #26536 --- 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 ;